I currently have the following XSLT code to find the number of days between two dates:
<xsl:value-of select="umbraco.library:DateDiff($shipDateString, $dateTodayString, 's') div 86400"/>
However, I need to be able to enhance this by excluding weekend days from the final figure and also by excluding other dates (input by the user via a uComponents multiple date picker).
I wondered if there are any methods in the uComponents Dates XSLT extension which I could 'bend' to help with this (can't really see any, but worth asking) or whether I just need to create a new nodeset from splitting up the $shipDateString and $dateTodayString range and iterating through it and doing a string comparison to return the appropriate dates?
Any ideas as to the best way to tackle this are very welcome, thanks!
Exclude weekends and specific dates from range
Hi,
I currently have the following XSLT code to find the number of days between two dates:
However, I need to be able to enhance this by excluding weekend days from the final figure and also by excluding other dates (input by the user via a uComponents multiple date picker).
I wondered if there are any methods in the uComponents Dates XSLT extension which I could 'bend' to help with this (can't really see any, but worth asking) or whether I just need to create a new nodeset from splitting up the $shipDateString and $dateTodayString range and iterating through it and doing a string comparison to return the appropriate dates?
Any ideas as to the best way to tackle this are very welcome, thanks!
Hi Dan,
Hmmm... take a look at the documentation, see if there's anything useful? http://ucomponents.codeplex.com/wikipage?title=Dates&referringTitle=Documentation
We've got a method called "AddWorkdays(string date, int days, string format)" - not sure if that might help?
If you come up with something new, then we can add it to uComponents. :-)
Cheers, Lee.
I've added a couple of new methods to the Dates library... "ListDates" and "WorkdaysDiff".
These will be available in v2.2 (stable), which should be out very soon!
Cheers, Lee.
is working on a reply...