Jump to:

1149 Posts in 2553 Topics by 408 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » Date - LocalFormat() deleted ? HELP! [solved]

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1071 Views
  • Laax
    Avatar
    Community Member
    14 Posts

    Date - LocalFormat() deleted ? HELP! [solved] Link to this post

    Hi,
    I was using this function in the template like this :

    $BeginDate.LocalFormat(%d %B %Y)

    It was so usefull as I develop french websites and this function took into account the setlocale settings.

    This function was deleted (why?? by the way) and this is big pain for me as I upgrade a website that uses it a lot!
    I assume that I shoul use a decorator on the class Date to add this function back?

    Does someone has another idea?
    Does someone can help me produce the code.. I never tried decorator before?

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Date - LocalFormat() deleted ? HELP! [solved] Link to this post

    Hi!

    Try using FormatI18N() with the same arguments. I've not been able to make it work here, but it's the function you can find in the new Date class.

    Regards,
    Juan

  • Laax
    Avatar
    Community Member
    14 Posts

    Re: Date - LocalFormat() deleted ? HELP! [solved] Link to this post

    Oo.. you'r right!
    I didn't find it in the 2.3.0 but it's definitely in the 2.3.1.
    Thank you very much for your help

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Date - LocalFormat() deleted ? HELP! [solved] Link to this post

    Happy to help. By the way, my problem was with the localization string for the languages I use, some research is needed, depending on the server.

    1071 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.