Copied to clipboard

Flag this post as spam?

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


  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 16, 2009 @ 21:50
    Jan Skovgaard
    0

    Bug in the ShortTime XSLT extension?

    Hi

    As I am trying to document some of the XSLT extensions I just noticed something, which I am not sure is a bug or just me giving the wrong input.

    When I write the following

    <xsl:value-of select="umbraco.library:ShortTime('16-07-2009')"/>

    It returns the following output: 00:00

    I would have expected to get the current time like 21:48 instead?

    Could this be because I am using the danish culture? If I use the CurrentDate() extension the correct time is returned.

    I have been using the same dateformat as the one mentioned above with the GetWeekDay() extension and that works fine.

    So I am wondering wether I am providing the date in the wrong format or if the extension is a bit buggy.

    /Jan

  • Paul Sterling 718 posts 1534 karma points MVP 9x admin c-trib
    Jul 16, 2009 @ 21:57
    Paul Sterling
    100

    Jan -

    I think this is because you're passing the short date format as the argument.  I believe if you pass in a full date-time string you'll get just the short time part returned and formatted.

    -Paul

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 16, 2009 @ 22:02
    Jan Skovgaard
    0

    Ah yes off course. You are absolutely right Paul. Thanks :)

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 16, 2009 @ 22:05
    Morten Bock
    1

    Just for the next guy:

    <xsl:value-of select="umbraco.library:ShortTime(umbraco.library:CurrentDate())"/>
Please Sign in or register to post replies

Write your reply to:

Draft