akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
954 stars 516 forks source link

L10n date format #4309

Closed a2xchip closed 8 years ago

a2xchip commented 8 years ago

I'm reporting a Bug or I'm asking a Question

Documentation says that we have to set our php.ini to Etc/Utc. Whatever it means i tried both: our locale Europe/Chisinau and Etc/Utc with russian language system settings but it shows dates in wrong format in that formatted places and it shows wrong time in that unformatted like import/export history and so on.

The question is:

skeleton commented 8 years ago

Hi @a2xchip ,

Inside the PIM, dates are formatted by PHP library http://php.net/manual/fr/class.intldateformatter.php. If in your account, your locale (to define in My account > tab "Interfaces") is defined as Russian (locale = ru_RU) and dates format provided by IntlDateFormatter are not OK for you, you can update them in the PIM configuration. You can follow this documentation: http://docs.akeneo.com/1.5/cookbook/localization/how_to_use_the_presenters.html#how-to-modify-the-predefined-formats-of-default-presenters

Your result should look like:

pim_catalog.localization.factory.date.formats:
    en_US: 'MM/dd/yyyy'
    fr_FR: 'dd/MM/yyyy'
    ru_RU: 'dd/MM/yyyy'
pim_catalog.localization.factory.datetime.formats:
    en_US: 'MM/dd/yyyy hh:mm a'
    fr_FR: 'dd/MM/yyyy HH:mm'
    ru_RU: 'dd/MM/yyyy HH:mm'
a2xchip commented 8 years ago

@skeleton Thx for your answer. After some working around i got default datetime formats working as they should. The problem was the fallback locale in parameters.yml set to en. The version we use in production is 1.4.2-x-dev

a2xchip commented 8 years ago

@juliensnz It was too early to close it. As @skeleton explained:

If in your account, your locale (to define in My account > tab "Interfaces") is defined as Russian (locale = ru_RU) and dates format provided by IntlDateFormatter

but as i understand now system skips settings and depends directly on parameters.yml fallback locale. At least for 1.4.2

I need time to check how it works in both versions to understand why it is so in our production environment. May be there is bug but may be not....