Meta Box
Support Forum
Support › General › Choose the language of the date fieldResolved
Hello, I would like the format of the date is displayed in French and not in English, is it possible?
rwmb_the_value(rw_date_prochaine_ceremonie, array('format' => 'j F Y')
Yes, that's possible. To output the date in a different format, please use this code:
rwmb_the_value( $field_id, array( 'format' => 'F j, Y' ) );
Thank you Anh Tran, I misspoke, sorry, I would like to translate the months, not change the format.
I got it. Please use the date_i18n function as follows:
date_i18n
$date = get_post_meta( get_the_ID(), 'field_id', true ); echo date_i18n( 'F j, Y', $date );
For more info, please check this docs.
Hi Ahn Tran,
I would like to do the same but inside views. I cannot find the way to use it with Twig environments, can you help for this please ?
Thanks in advance.
Finally, i've found the working solution right here on the forum: https://support.metabox.io/topic/date-field-output-not-localized/
Thanks !
Hi Han Tran, thanks for your reply.
Your code only return the current date in french format, not the date field content in french format. How can we make it work ?