Posted: April 29, 2019 at 6:10 am
I have read this (now closed) post from Jan 2018, and I have used this fix in my functions file, but I see another issue now. While the date is dd/mm/yy now, in my list of events they are displaying sorted by day then month (so for example 07/05/2019, 08/06/2019, 11/05/2019). Is there a way to sort this correctly? |
|
May I ask which post did you get the code from? Also, if you remove the code from your functions.php file, does the list of events go to the correct order? Is this happening on the front end event list, the admin event list, or both? |
|
https://eventespresso.com/topic/date-picker-format-when-entering-events/ |
|
Oh, Good point. The sort order in the front end doesn’t seem to be related to that code in the functions file, so it must be something else. This is the page with the list of events. https://newsite.yhabush.org.au/activities/current-walks-program/ |
|
Can you please post a link to the thread you found or the code you are using so we know what that is doing? What’s the full shortcode you are using to load the table view? The sort.js file included within our add-on isn’t loading, it looks like your theme is ordering the file with its own and that’s likely what is causing the sorting error as I don’t get that with our version. |
|
Original thread with the same subject: https://eventespresso.com/topic/date-picker-format-when-entering-events/ |
|
shortcode in the page is: |
|
Ok, so yeah yeah that code is completely unrelated to the event table.
Thank you. So if you temporarily switch themes to a default theme such as twentyseventeen, do you see the same issue on the table view template? You can switch themes without affecting your users using with the WP Health Check plugin and enabling troubleshotting mode, which disabled all plugins and switches to a default theme for the current users. Or use the WP Theme Test Drive plugin to switch themes for the current admin. |
|
OK, I have found this javascript on the template page that when I remove it the order is correct. I think this bit is just to add the ability for the user to change the sort order of columns. Can you identify the error in here? |
|
No, because the problem is that you’re using a custom script (not the above) from the theme to sort the table and it looks like that script isn’t sorting the table correctly, apparently based on what the above is setting. I’m guessing it is this line EE doesn’t use the date output in the column to sort the table so it doesn’t need to know the format, it uses the timestamp value set on the row – https://monosnap.com/file/Yuvxlho0B4PKtwllALjPvhAzYeBsxi |
|
Thanks Tony, is there any other script that would allow the columns to be sortable in the front end? |
|
Removing So, if you remove the above does sorting work on that page? |
|
I tried removing that bit in the shortcode but unfortunately that didn’t fix the sorting. It still sorts by the day first and not by the year/month first. |
|
Yeah so most likely your theme’s script is still conflicting. If you switch to a default theme such as twentyseventeen and view the table view template, does it work then? I posted detaisl on how you can do that without disrupting your visitors in a reply above. |
|
Yes it works OK in the default theme. I didn’t build this custom theme so I will have to try and find out what is causing the conflict. |
|
It’s the You’ll need to de-enqueue that script on that specific page for the EE table to work, I don’t recommend removing if completely from the site as other pages may be using it. |
|
The support post ‘Date picker Format when entering events’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.