Copied to clipboard

Flag this post as spam?

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


  • Jeff Kwong 31 posts 51 karma points
    May 21, 2010 @ 21:17
    Jeff Kwong
    0

    DateGreaterThanOrEqualToday Error

    I'm trying to use DateGreaterThanOrEqualToday to display a list of nodes.  The XSLT saves fine, but when I view the page I get an error: Error parsing XSLT file: \xslt\ListFutureEvents.xslt

    Here's where I'm using it:

    <xsl:variable name="eventNodes" select="umbraco.library:GetXmlNodeById($source)/node [(string(data [@alias='umbracoNaviHide']) != '1') and (umbraco.library:DateGreaterThanOrEqualToday(umbraco.library:FormatDateTime(./data[@alias = 'dateStart'], 'dd/MM/yyyy')))]"/>

    When I yank the DateGreaterThanOrEqualToday conditional, it works fine but displays past events.  I've also outputted the FormatDateTime and I have a well-formed date being passed to the function.  Any ideas?  I've been using the following post for reference:

  • Tom Fulton 2030 posts 4996 karma points c-trib
    May 21, 2010 @ 22:02
    Tom Fulton
    0

    Just for kicks, maybe try removing the FormatDateTime or try formatting differently?

    The below code works for me, eventEndDate is coming directly from a Date Picker w/Time

    <xsl:for-each select="$currentPage/node [@nodeTypeAlias = 'Event' and umbraco.library:DateGreaterThanOrEqualToday(data[@alias='eventEndDate'])]">

     

  • Jeff Grine 149 posts 189 karma points
    May 21, 2010 @ 22:05
    Jeff Grine
    0

    Looks like that function will throw an exception if it won't parse as a date. Have you tried changing your format to MM/dd/yyyy? Seems like if your culture settings are set to US a string like 21/05/2010 might not parse as a date. 

    If that's not it, best to run it in the debugger locally to see what exception is actually being thrown.

  • Darryl Godden 145 posts 197 karma points
    May 22, 2010 @ 10:32
    Darryl Godden
    0

    Get your date and put it into the variable with the date format. Then use XSL if to test the DateGreaterThanOrEqualToday.

  • Jeff Kwong 31 posts 51 karma points
    May 24, 2010 @ 20:57
    Jeff Kwong
    0

    Ugh, the date formatting was the issue.  Thanks so much.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies