Sorting dates
-
Hi,
Thanks for your plugin. Keep up the good work!
I’m having an issue with the table sorting by a custom date column created by the Advanced Custom Fields plugin. The date is sorted only by the day of month but not by the whole date and time string. The date format is d.m.Y H:i and I am using a few aproaches with code to resolve the issue, as described in your site, but it persists.
Here is what the wrong result looks like:
https://prnt.sc/ur88w8Here is the code I’ve unsuccessfuly used by now:
add_filter('wc_product_table_custom_field_stored_date_format', function($format, $field) { if ('coursedate' === $field) { return '"d.m.Y H:i"'; } return ''; }, 10, 2); add_filter( 'wc_product_table_custom_field_is_eu_au_date', function( $is_eu_date, $field ) { if ('coursedate' === $field) { return true; } return false; }, 10, 2 );Both don’t work. Please advise.
Thank you in advance.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Sorting dates’ is closed to new replies.