Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 1285 posts 3917 karma points c-trib
    Jun 30, 2011 @ 15:11
    Dan
    0

    Exclude weekends and specific dates from range

    Hi,

    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!

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 30, 2011 @ 15:18
    Lee Kelleher
    0

    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.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jun 30, 2011 @ 22:14
    Lee Kelleher
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft