Support Forum
There is a Chinese character appearing in my datepicker. I'm not sure why this is… screenshot here.
Hi,
It might relate to the language or a plugin activated on your site. Please go to Settings > General > Site language: English, deactivate all plugins except Meta Box, and re-check the issue.
You can also share the JS options of the date
field, I will test the options on my end.
You're right, I should have checked plugins. It's clashing with the Formidable Forms plugin. When I disable that the colour of the datepicker changes and the whole thing looks smarter.
Thinking about it, there's a datepicker form on that page, which is loading the preview text for the datepicker, so I guess that's where it's picking up the styling from.
Also, it seems to be unrelated as it still happens with the formidable plugin deactivated, but the 'save_format' setting is being ignored. This is causing issues with date interpretations.
Settings below:
array(
'name' => esc_html__( 'To date', 'textdomain' ),
'id' => $prefix . 'to_date',
'desc' => esc_html__( 'End of date range', 'textdomain' ),
'type' => 'date',
// Date picker options. See here http://api.jqueryui.com/datepicker
'js_options' => array(
'dateFormat' => 'dd/mm/yy',
'changeMonth' => true,
'changeYear' => true,
),
'save_format' => 'yy-mm-dd',
),
Can anyone help me with the Date Format issue? It's causing me real problems and I need to make the site live.
Hi,
Can you please let me know which wrong with the setting save_format
? The format of the date should be
array(
'name' => esc_html__( 'To date', 'textdomain' ),
'id' => $prefix . 'to_date',
'desc' => esc_html__( 'End of date range', 'textdomain' ),
'type' => 'date',
// Date picker options. See here http://api.jqueryui.com/datepicker
'js_options' => array(
'dateFormat' => 'd/m/y',
'changeMonth' => true,
'changeYear' => true,
),
'save_format' => 'Y-m-d',
),
Get more details here https://www.w3schools.com/php/func_date_date_format.asp
Hi, yes, the save_format is 'Y-m-d', but the date is being saved as d/m/y. This is causing an issue with strtotime
on the front end.
Hi,
The function strtotime()
parse the text date time to Unix timestamp. You can use the setting 'timestamp' => true
to save the timestamp value to the database. Please get more details on the documentation https://docs.metabox.io/fields/datetime/#settings