Date picker doesn't show correctly when I set date format
Date picker doesn't show correctly when I set date format. When I set the date format to d/m/Y, I'm unable to choose a date after today, the field goes blank.
Can you please provide your CMB2 configuration?
$tenders_meta->add_field( array( 'name' => esc_html__( 'Closing Date', 'notion' ), 'desc' => esc_html__( 'Specify the closing date.', 'notion' ), 'id' => $prefix . 'tender_closing_date', 'type' => 'text_date', 'date_format' => 'd/m/Y', ) );
That 'date_format' cannot be parsed by php's strtotime(). See this answer on stackoverflow: https://stackoverflow.com/a/2891949
Basically, you can use either 'm/d/Y' or 'd-m-Y', but not 'd/m/Y'. If you do want to keep this format, you'll have to do some re-converting magic with the 'sanitization_cb' parameter.
@ancilkanto Just use text_date_timestamp and when you need to output it use date_i18n
I had the same issue for months and new found, maybe add an error in CMB?