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.
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.
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...
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
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
The links to your screenshots are broken. Code should not use screenshots in the first place — 1. for this very reason, and 2. because copy and paste isn't possible — but can you please add it now? If I have
[rwmb_meta id="event_date"], which outputs as "2022-02-03 19:00" by default, how do I get it to output as "February 3, 2022"? Thank you.
Here are the screenshots https://imgur.com/a/XtVAbWf
The date format option works with the Beaver builder as well.
This is what I ended up with:
[rwmb_meta id="event_date" format="F j, Y"]