• Creator
    Topic
  • #23553
    Resolved pw@grafik-designer-hannover.de
    Participant

    Hi, i use Beaver Themer and created Meta Box custom fields with date picker. Unfortunately the date format is in english instead of german. How can i fix this?
    I use this shortcode from Beaver Themer [wpbb post:meta_box field='datum' date_format='d. F Y']. Language setting for the site is DE = German.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #23560
    Long Nguyen
    Moderator

    Hi,

    You can use the setting js_options to format the date. If you are using the Meta Box Builder, please use the dot notation to apply the setting for the field date. Screenshot https://share.getcloudapp.com/5zud9Jkz.

    It shows in the Beaver editor as well https://share.getcloudapp.com/NQuK7vPL.

    #30681
    AnLip
    Participant

    Hello Long,

    I am having trouble finding the correct code to change date format to "dd month" AND have the month show in French.

    For the moment I am using this code :

    $meta = rwmb_meta( 'dlc_agenda_date' );

    $meta = get_post_meta( get_the_ID(), 'dlc_agenda_date', true );
    echo date_i18n( 'j F', $meta );

    but it is pulling the actual date (the date it is today, whatever the date), not the value from my meta_key "dlc_agenda_date" as I would like it to...

    Please let me know what I am not doing right...

    #30682
    AnLip
    Participant

    EDIT : I have found a workaround using Oxygen Builder, using the new Advanced Query function. But I believe some still might want to have a clear example of code applying to changing a date format and ordering query results by meta_key value.

    Thank you if you can take the time

    #30691
    Long Nguyen
    Moderator

    Hi,

    You need to pass the timestamp value type to the second argument of the function date_i18n(). Set 'timestamp' => true when registering the date field.

    Get more details here https://docs.metabox.io/fields/date/#settings

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