• Resolved anakeimai

    (@anakeimai)


    Hi,

    Sorry to ask what seems a daft question (as it appears to be working for everyone else).

    I’ve done a fresh install with the latest version of the TablePress plugin (Version 2.1.7) + TablePress Extension: DataTables Sorting plugin. I’ve added a sample table on a test page on one of our websites.

    By default, the dates do not sort properly – it sorts by the first number in the date string, not in UK date order.

    I’m not installing any custom Javascript or other files (not sure if I’m supposed to), and have messed about copying strings into the Custom Commands text field in the Editor from others who have struggled, but still cannot make it work.

    I’d be grateful for any help!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I’m not sure that I can follow. When I open that link, the table is sortable by the date in the second column without problems?

    Or am I missing something?

    Regards,
    Tobias

    Thread Starter anakeimai

    (@anakeimai)

    Hi Tobias,

    Thanks for your response! Apologies, try now (with data that is causing me the headache)

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ah, these dates have two-digit year only, which might be throwing off the automatic detection. You could try setting the format manually. For that, please add this to the “Custom Commands” text field in the “Table Features for Site Visitors” section on the table’s “Edit” screen:

    "columnDefs": [ { "type": "date-eu", "targets": [ 1, 3 ] } ]

    (The 1, 3 indicates that this should apply to columns 2 and 4, as counting the columns starts with 0 for the first column.)

    Regards,
    Tobias

    Thread Starter anakeimai

    (@anakeimai)

    Hi Tobias,

    You’re assessment was bob on thank you! Slight issue with the code you provided which stopped the sorting working, but all I needed to do (without this addition) was to ensure that all my dates had the full year listed and everything started working magically. Thank you! Great plugin.

    • This reply was modified 2 years, 9 months ago by anakeimai.
    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘UK Dates Sort Not Working with TablePress’ is closed to new replies.