Copied to clipboard

Flag this post as spam?

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


  • Aleksander 26 posts 56 karma points
    Jul 07, 2009 @ 13:41
    Aleksander
    0

    Generic property date format

    Hello!

    I`d like to change the date format of the embaded generic properties (uodateDate, createDate e.t.c). I can use umbraco.library:FormatDateTime to format my oun property, but I don`t know how to reach the propeties mentioned above. Can anybody help me?

    Thanks a lot in advance!

  • Jesper Hauge 298 posts 487 karma points c-trib
    Jul 07, 2009 @ 13:47
    Jesper Hauge
    1

    You should be able to use umbraco.library:FormatDateTime on updateDate and createDate like this:

    <xsl:value-of select="umbraco.library:FormatDateTime($currentPage/@updateDate, "dd.MM.yyyy")" />

    For createDate just substitute @updateDate with @createDate in the above statement.

    Regards
    .Hauge

  • Jesper Hauge 298 posts 487 karma points c-trib
    Jul 07, 2009 @ 13:49
    Jesper Hauge
    1

    A minor error - use this instead:

    <xsl:value-of select="umbraco.library:FormatDateTime($currentPage/@updateDate, 'dd.MM.yyyy')" />

    .Hauge

  • Tommy Poulsen 514 posts 708 karma points
    Jul 07, 2009 @ 13:51
    Tommy Poulsen
    0

    Hi Aleksander, if I understand you correctly it's a matter of accessing node properties. Any content node has and updateDate and createDate, and they can be accessed as a normal property by e.g.

    <xsl:value-of select="$currentPage/@createDate"/>

    But maybe I misunderstood?

    >Tommy

  • Tommy Poulsen 514 posts 708 karma points
    Jul 07, 2009 @ 13:51
    Tommy Poulsen
    0

    aah - Jesper already answered ;-)

  • Tommy Poulsen 514 posts 708 karma points
    Jul 07, 2009 @ 13:54
    Tommy Poulsen
    0

    by the way - you can see all available node properties here : http://blackpoint.dk/umbraco-workbench.aspx?Snippet=/umbraco-workbench/xslt/accessing-node-information.aspx

    >Tommy

     

  • Aleksander 26 posts 56 karma points
    Jul 07, 2009 @ 17:04
    Aleksander
    0

    Hi!

    Thank a lot for the quick answers, but actualy my questions was how to replace the existing date format with
     my own. The examples above, as I understand are how to pick the properties of the page. But I  want (if it`s possible) to replace the existing date format in the admin panel with another one.

    Excuse me for the misunderstanding!

    Thanks,

    Aleksander.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 07, 2009 @ 18:39
    Jan Skovgaard
    0

    Hi Aleksander

    Do you want to be able to select a date yourself for a specific node? If you for instance have some news nodes where you want to add a date you could specify a date field on your document type and use that instead of the @createDate and @updateDate.

    Is this what you are looking for?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 07, 2009 @ 18:41
    Jan Skovgaard
    0

    Hi Tommy

    Great post! Maybe you should add it to the wiki-section also? I think it would be a very good contribution.

     

    /Jan

  • Aleksander 26 posts 56 karma points
    Jul 08, 2009 @ 08:36
    Aleksander
    0

    Hi Jan

    When you create some document type, there are some embedded properties, that appears on the 'Properties' tab by default. For example, the third property is  named 'Created' and actualy shows the date of creation of the document type. My question is: can I just set the format of this date, without changing the default culture of my PC or the language settings in Umbraco?

    Thanks,

    Aleksander

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 08, 2009 @ 10:01
    Jan Skovgaard
    0

    Hi Aleksander

    Ok - But I think that Jesper has already answered that then? You don't need to format the date like he has done. It is entirely up to you how you want it to look like. Instead of "dd.MM.yyyy" you could have "MM/dd/yyyy" for instance. It's all up to you.

    Hope this helps.

    /Jan

  • Aleksander 26 posts 56 karma points
    Jul 08, 2009 @ 15:14
    Aleksander
    0

    Hi,

    maybe I can`t  explain or, just can`t understand, but I want to change the display format of the dates in admin panel, not to pick them and place in other part of my application.

    Thanks,

    Aleksander

  • Jesper Hauge 298 posts 487 karma points c-trib
    Jul 09, 2009 @ 01:03
    Jesper Hauge
    100

    Ok - now I get it. You're trying to alter the way dates are displayed in the Umbraco backend. 

    As far as I know there's no setting anywhere that controls the display of dates (please anyone; correct me if I'm wrong), so if it's really important to you, you'll probably have to download the source code for Umbraco and change the code to suit your needs. But that will make your changes vulnerable to future upgrades.

    You could also try adding this as an Issue on codeplex, and suggest the core team changes the date display code to use a datetime.ToString() that outputs a localized version of the date. That would render the date in a way that corresponds to the regional settings of the server Umbraco is running on.

    Regards
    .Hauge

Please Sign in or register to post replies

Write your reply to:

Draft