Format dd/mm/yy doesn't work
-
I’m using the date format dd/mm/yy, however after saving the date either disappeared or came back in the wrong format. For example, saving 06/11/2013 would come back as 11/06/2013.
The problem is because the plugin uses the strtotime() PHP function which assumes the day and month be in a specific order. As a result I changed the update_value() function in file date_time_picker-v4.php as follows:
function update_value( $value, $post_id, $field ) { $field = array_merge($this->defaults, $field); if ($value != '' && $field['save_as_timestamp'] == 'true') { if ($field['date_format'] == 'dd/mm/yy') { $value = str_replace('/', '-', $value); } $value = strtotime( $value ); } return $value; }
Otherwise, great plugin ??
https://www.ads-software.com/plugins/acf-field-date-time-picker/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Format dd/mm/yy doesn't work’ is closed to new replies.