ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 8 replies, has 4 voices, and was last updated by Stepan Yudin Stepan Yudin 1 year, 10 months ago.

  • Creator
    Topic
  • #13985
    Stepan Yudin
    Stepan Yudin
    Participant

    Hi everyone!

    Is there an easy solution to change Date and DateTime format?
    In fact, i have to change format without switching the locale in settings. And i didnt found anything that looks like settings for date/datetime formatter in LocaleBundle configuration class.


    Docker environment for Symfony2/OroCRM/OroBAP development on Windows platform
    https://github.com/stepansib/sf-oro-docker

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #13993

    Rodolfo
    Participant
    #14088
    Artem Liubeznyi
    Artem Liubeznyi
    Oro Core

    Hi Stepan,

    Do you want to make changes in the date/time formatting on the system/org level, or apply them to a specific fields only? Please tell us more about your use cases.

    Thank you.

    #16041

    umatkid
    Participant

    Oro guys help please!I have the same problem, I want change date/time format for all system. Can you help with it.

    #16046
    Artem Liubeznyi
    Artem Liubeznyi
    Oro Core

    Sure. Same question for you though: Can you please specify, what format you are trying to change exactly? Normally, the date & time format of an organization depends on its configured locale; please refer to our user guide to learn how to change it.

    #16056
    Stepan Yudin
    Stepan Yudin
    Participant

    Yes, I found solution several month ago, afternoon i will post it here. In summary – i extended Formatter and use new class in formatter service


    Docker environment for Symfony2/OroCRM/OroBAP development on Windows platform
    https://github.com/stepansib/sf-oro-docker

    #16057

    umatkid
    Participant

    Hi Oro guys.I need the format “d.m.Y H:i:s”.
    @Stepan, Can you share with me your solution please?

    #16069
    Stepan Yudin
    Stepan Yudin
    Participant

    Sorry for delay, i was really busy last quarter.
    My task was to define only one DateTime format for any locale choosed Oro in settings.
    This solution is little dirty but works)

    0. I created my own LocaleBundle

    1. I extended DateTimeFormatter (see parent class and bundle for explanation)

    2. I replaced DateTimeFormatter class in my bundle services.yml with my new OQDateTimeFormatter class:


    Docker environment for Symfony2/OroCRM/OroBAP development on Windows platform
    https://github.com/stepansib/sf-oro-docker

    #16070
    Stepan Yudin
    Stepan Yudin
    Participant

    And dont forget to clear all caches and dump all JS (because there are dependencies with moment.js)


    Docker environment for Symfony2/OroCRM/OroBAP development on Windows platform
    https://github.com/stepansib/sf-oro-docker

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.