Copied to clipboard

Flag this post as spam?

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


  • Jonas Eriksson 930 posts 1825 karma points
    Aug 18, 2010 @ 14:30
    Jonas Eriksson
    0

    Testing a string for a valid date in Xslt

    How can I do that?

    Cheers

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Aug 18, 2010 @ 14:31
    Sebastiaan Janssen
    2

    One fun thing to try would be umbraco.library:FormatDateTime - if you get 1-1-1900 then it's not a valid date.

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 18, 2010 @ 14:41
    Jonas Eriksson
    0

    Works good enough, thanks!

     

  • Peter Duncanson 430 posts 1358 karma points c-trib
    Aug 18, 2010 @ 14:43
    Peter Duncanson
    2

    Yeah using XSLT like that is a bit of a mine field, best to drop down to .net (via the Extensions mentioned above is a nice easy way to do it) and let it handle it, it does a much finer job.

    Remember XSLT is a templating language not a programming one and all should be fine :)

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 18, 2010 @ 14:46
    Jonas Eriksson
    0

    Peter, yes, only I have some old sins I need to take care of before I get the time to port them to .net or Py.

  • 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