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 5060 posts 15522 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 1360 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.

Please Sign in or register to post replies

Write your reply to:

Draft