Custom Fields
Re-Envisioned
Support MB Custom Post Type How to Format Datetime in Oxygen Builder?

  • Creator
    Topic
  • #29854
    Tobias Haas
    Participant

    Dear MB Team,

    How can I change the format of the date?

    Standard is 2021-08-02
    i want: 02.08.2021

    I get the date from Dynamic Data in Oxygen

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #29856
    Tobias Haas
    Participant

    And how can I set the time to UTC + 1?

    #29866
    Long Nguyen
    Moderator

    Hi Tobias,

    You can use the setting js_options to change the date format, such as

    'js_options' => [
        'dateFormat' => 'dd.mm.yy',
    ],

    If you are using the Builder, please use the option Date picker options https://imgur.com/8ip8rgD

    Get more details on the documentation https://docs.metabox.io/fields/date/#settings

    #29867
    Tobias Haas
    Participant

    Hi Long

    Your documentation would be much better if you showed a lot more examples.
    for me as a beginner it is a torture ...

    And how can I set the locale?
    I want to display the days in German language.

    thank you for your help 😉

    #29870
    Long Nguyen
    Moderator

    Hi,

    To display the date in the German language, you need to follow these steps:
    - Set the site language in Admin dashboard > Settings > General > Site language: German
    - Set the timestamp to true
    - Use the function date_i18n() and follow the documentation to output the localization date.
    https://docs.metabox.io/fields/date/#template-usage

    It might be complicated for the beginner but Meta Box is a developer tool, it helps you to output the raw value. So you need to have a basic knowledge of coding to display the value in any way you want.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.