Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Questions about i18n::date and jQuery

edited May 2013 in Miscellaneous

The translation apps seems to permit custom format string for short/long date/time, but elefant cms don't seems to use them.

For example, the {{ ts|I18n::date_time }} in the blog post view don't use the format specified in the language definition, but the defaut one.

Looking at the i18n::date_time function, the string format is hard-coded, and the function docstring say:

 * Filter for outputting date and time. Used with the jQuery
 * localize plugin to convert dates into the current user's
 * time zone.

But it seems to me that the jquery plugins doesn't works either... at least related to format (days and months names are localized, but not using the localized format string)

What's needed for this to work ?

Thanks for your help!

Comments

  • I'll have to take a look, but it sounds like something I started and didn't finish yet :P

  • Ah yes, now I remember. The localize plugin needs to be initialized by the admin/util/dates handler, so at the top of your view template you need to add this line:

    {! admin/util/dates !}
    

    Or in your handler you can call $this->run ('admin/util/dates'); to include it from there. After that, the localize plugin should format the dates correctly. There's a little info on it here:

    http://www.elefantcms.com/wiki/JavaScript-and-Client-Side-Helpers

Sign In or Register to comment.