Hi Jiceo,
I thought that I had things localized for foreign users. just tested, and it doesn’t look to be working at the moment. I will nee do to do a small update, and patch the issue.
Thanks,
Evan
Hi Jiceo,
To follow up, the following snippet should help out:
add_filter( 'cmb2_localized_data', 'prefix_cmb_set_date_format' );
function prefix_cmb_set_date_format( $l10n ) {
$l10n['defaults']['date_picker']['dateFormat'] = 'dd/mm/yy';
return $l10n;
}
You’ll want to add that to your themes functions.php file – which will localize the date picker for you.
Let me know if that helps!
Thanks,
Evan
This should now be fixed in the latest release. I have localized the dates appropriately based on the WordPress options.
If you are still having issues feel free to post here and let me know!
Thanks,
Evan
Thread Starter
jiceo
(@jiceo)
Hi Evan,
It works like a charm now ! Thx for your help and your fix.
The only very little other thing, the date is still shown with english format.
mm/dd/yyyy in the background after selecting the date from date picker. It’s not really important, but for our french customers, could be better if the date is in the right format.
Thx again.
Jerome
Hi Jerome,
What do you mean that it displays that in the background? Where is it still displaying incorrectly?
Thanks,
Evan
Thread Starter
jiceo
(@jiceo)
Hi Evan,
Sorry, I would say back-office instead of background π ! As I said, now the date picked from calendar picker is saved correctly into database but, after we click on the date from calendar, the announcemnt date is still displayed with english date format mm/dd/yyyy instead of dd/mm/yyyy into wp-admin/post.php?post=100&action=edit page.
When we enter into the edit page, the date is displayed with english format but with another format :ex 1 may 2016.
Thx for all.
Jerome
Hi Jiceo,
What is the date format that you have setup in Settings > General > Date format?
Thanks,
Evan
Thread Starter
jiceo
(@jiceo)
Hi Evan,
The first one of the list :
currently my settings are :
Format date : ’19 mai 2016′
Time zone : Paris
Site language : Francais
Hope can help you…
Jerome
Hi Jerome,
What does the last option say under the date settings? It should be a string of letters.
Thank you,
Evan
Thread Starter
jiceo
(@jiceo)
Hi Evan,
It’s not selected but here are : j F Y
Jerome
It doesn’t matter if it’s selected or not, this is the string that actually controls the date format.
I will have to test against this format. I didn’t build in support for this format – as it was not what was originally mentioned in the first post.
What you had originally mentioned was d/m/y (15/05/2016), which is what I had built into the plugin.
I will have to build in support for additional dates in future updates. For the meantime, I would recommend altering your date to m/d/y, or just holding off until the update is out.
Thanks,
Evan
Thread Starter
jiceo
(@jiceo)
Hi Evan,
No problem ! I’ll wait for a further updates π !
It’s just a cosmetic issue in BO, not very important :).
Thx for all and your spent time !
Bye !
Jerome
Hi Jerome,
I am just pushing out an update (v1.2.7) that now has support for j F Y date formats.
Thanks!
Evan