I am trying to: sort a view by a custom date field
Link to a page where the issue can be seen: hidden link
I expected to see: the date to be sorted by date
Instead, I got: the data sorted (i think) alphabetically.
Here's my view: hidden link
Hi Amin,
Thank you for contacting us and I'd be happy to assist.
I've tested a date field in a similar view with a sortable table layout on my website, but couldn't reproduce this issue.
To troubleshoot it, I'll suggest the following steps:
1. Please make sure that WordPress, active theme and plugins are all updated to the latest versions.
2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty.
If it's fixed, you can start adding the disabled items, one-by-one, to narrow down to a possible conflicting one.
3. In case the issue still persists, I'll need to see exactly how this view and the date field's data is set up, to be able to reproduce it on a test website.
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
regards,
Waqar
I think I may have figured out the problem.
In my spreadsheet, the date was entered as 1/2/2020 12:00am. I changed it to Unix Timestamp and am re-importing the data.
Is there an ideal date format when importing in bulk into a custom post type with custom date field?
Thanks for the update and that explains it.
By default, Toolset's "date" type custom field stores the date in Unix Timestamp.
For this reason, it is important that if you're importing data in this field, that data is also added in this same format, so that Toolset's date related operations (like filters, sorting etc), can be used with those custom field values too.
( ref: https://toolset.com/documentation/user-guides/views/date-filters/ )
I hope this helps.