Jump to:

1851 Posts in 1606 Topics by 561 members

Blog Module

SilverStripe Forums » Blog Module » Date Field in Blog Module

Discuss the Blog Module.

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

Page: 1 2
Go to End
Author Topic: 6448 Views
  • stooni
    Avatar
    Community Member
    89 Posts

    Date Field in Blog Module Link to this post

    Hello hou can i change the language from the Month Field not --- March---- change to --- März--- and also Tag Cloud and

    Browse by Date --- Thanks

    --- Stooni

    these i have in mysite/_config.php integratet

    i18n::enable();
    i18n::set_locale('de_DE');

    When i give these i18n::set_default_lang('de');
    then!
    Website Error
    There has been an error

    The website server has not been able to respond to your request.

  • cliersch
    Avatar
    Community Member
    75 Posts

    Re: Date Field in Blog Module Link to this post

    Write this to set German language in the _config.php

    i18n::set_locale('de_DE');
    setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');

    But you have to write a Function to use the PHP Date like %B für "März".

  • stooni
    Avatar
    Community Member
    89 Posts

    Re: Date Field in Blog Module Link to this post

    thanks first!

    You can helb mie to write this i am not found these function!

    thanks

    ---stooni

  • Henk Poley
    Avatar
    30 Posts

    Re: Date Field in Blog Module Link to this post

    Free format date strings in the templates:

    $Date.FormatI18N(%e %B %Y %R)

    Apart from the changes in mysite/_config.php, you could add this to FormatI18N(), so it does setlocale() by itself:

    setlocale(LC_TIME, i18n::get_locale() . ".utf8");

  • stooni
    Avatar
    Community Member
    89 Posts

    Re: Date Field in Blog Module Link to this post

    ok super thanks very much !!!!

    First
    i18n::set_locale('de_DE');
    setlocale(LC_TIME, i18n::get_locale() . ".utf8");

    then in the templates rewrite format date
    $Date.FormatI18N(%e %B %Y %R) or $Date.FormatI18N(%e %B %Y) (without time!!)

    Thanks !!!!!!
    ---- some stones falling form my......

    ----stooni

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Date Field in Blog Module Link to this post

    Hi!

    Please stooni, could you say me what SS version are you using? Here, with 2.3.1, where i18n of pages has been somehow removed, I'm not able to use FormatI8N with dates. Maybe it's unrelated.

    Best regards,
    Juan

  • stooni
    Avatar
    Community Member
    89 Posts

    Re: Date Field in Blog Module Link to this post

    i use Version SST 2.3.1 with the template andreas02 these is the url :

    http://stalderprojects.stooni.ch/

    ---- Stooni

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Date Field in Blog Module Link to this post

    Thank you!

    6448 Views
Page: 1 2
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.