It looks like the dates in your example are backwards - you need the 'year' part first, then the month and lastly the date. More so, the second date is ambiguous, because even if the receiving function is able to figure out the year, it still wouldn't be able to tell if you meant "November 5th" or "May 11th".
Based on how you wrote the first date, this should work:
An error occurred during a call to extension function 'DateDiff'.
Just upgraded from 4.90 to 4.10.1 and umbraco.library:DateDiff stopped working.
<xsl:variable name="diffSeconds" select="umbraco.library:DateDiff('20-11-2012','05-11-2012', 's')" />
My options are to use javascript (not ideal) or to rewrite this XSLT in Razor. Any XSLT related help would be appreciated.
Also tried to access the XSLT library page to see if there were any changes, but its now a 403 forbidden link... http://our.umbraco.org/documentation/Reference/Api/Umbraco.Library/
Hi Hasheem - welcome to the forum!
It looks like the dates in your example are backwards - you need the 'year' part first, then the month and lastly the date. More so, the second date is ambiguous, because even if the receiving function is able to figure out the year, it still wouldn't be able to tell if you meant "November 5th" or "May 11th".
Based on how you wrote the first date, this should work:
/Chriztian
Thanks Chriztian!
This is my actual source and it now works:
<xsl:variable name="diffSeconds" select="umbraco.library:DateDiff(umbraco.library:FormatDateTime(umbraco.library:CurrentDate(),'yyy-MM-dd'),umbraco.library:FormatDateTime(@createDate, 'yyy-MM-dd'), 's')" />
Weird that it worked with the date format the wrong way round on v 4.7 -> 4.9!
is working on a reply...