• Resolved jamesin144

    (@jamesin144)


    I’m currently using this code
    datatables_order=’%5B%5B 0, “desc” %5D%5D’

    with data arranged like this with 4 columns

    1/12/2016 | 1.00009 | 1.00005 | 1.00004

    I’m trying to sort it via date but it’s doing it incorrectly and sorting by adding up the numbers e.g
    1/12 would be 112 and 5/11 would be 511 which causes problems e.g the current dates are laid out like this

    6/12
    5/12
    30/11
    29/11
    etc etc
    and then
    2/12

    where 2/12 should be up there in between 5 and 30

    Can anyone suggest a solution to this? I’ve formatted the data in the google sheets to be in a date format.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jamesin144

    (@jamesin144)

    The data is formatted like this on the google sheets

    30/12/2016 | etc | etc | etc
    1/12/2016 | 1.00009 | 1.00005 | 1.00004

    with each new entry going below in a new line for new values each day.

    Plugin Author Meitar

    (@meitar)

    You’ll need to tell DataTables that this column is a date and not just a string of letters. Have a look at the DataTables documentation for sorting. You’ll want to use one of the date-* options, and you’ll need to tell DataTables which column the data it should interpret as dates are in (using the columns.type option).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not able to sort by date’ is closed to new replies.