• Resolved kds81

    (@kds81)


    Hello Tobias,

    I have similar issues with date columns on two of my pages. There is each a table with two columns with German dates and I don’t get both date columns sorted correctly:
    https://vectraturbo.de/fahrzeugregister/
    https://vectra16v.com/i500register/

    I tried these two variants based on other customer questions 6 solutions for https://vectraturbo.de/fahrzeugregister/

    0) import the base data as .CSV

    1) active “Advanced sorting plugin 1.2” +
    columnDefs: [ { type: “formatted-num”, targets: [ 1, 8 ] } ]
    => both columns sorted not correctly date sorted

    2) page with additional configparameter “datatables_datetime=DD.MM.YYYY”
    => partly sorted
    -> 2nd column “EZL” not correctly date sorted
    => 9th column “last change” correctly DE date sorted

    So whats the correct way to get both columns sorted correctly?

    Thanks in advance,
    Kai

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

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

    (@tobiasbg)

    Hi @kds81,

    Thanks for your post, and sorry for the trouble!

    My recommendation here is to go with approach 2) (the datatables_datetime parameter). As shown in your 9th column, this will (normally) work fine.

    The reason why it’s not working for your 2nd column are the rows with ??.??. for the day and month. The sorting algorithm basically expects numbers here (as it can’t know how to treat quotation marks), and when it doesn’t find them, it reverts back to string/text sorting.

    Can you therefore maybe try replacing ??.??. with e.g. 01.01. or 31.12 (or some other date that makes sense, if you can’t find out the actual date)? If you would like to keep the ??.??., it would be necessary to design a custom sorting algorithm (the “Advanced sorting plugins” Extension could serve as a foundation for that) which then gets the additional knowledge about how to treat these ??.??. rows.

    Best wishes,
    Tobias

    Thread Starter kds81

    (@kds81)

    Hello Tobias,

    thanks for your help.
    I removed the questionmarks and changed it to a dummy date.

    Best Regards,
    Kai

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi @kds81,

    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 in the plugin directory. Thanks!

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

You must be logged in to reply to this topic.