koalyptus / TableFilter

A Javascript library making HTML tables filterable and a bit more :)
https://www.tablefilter.com
MIT License
323 stars 95 forks source link

Filter by date format dd/MM/yyyy HH:mm:ss sorts by the day not by the year #775

Closed Guyver1wales closed 4 years ago

Guyver1wales commented 4 years ago

I have a table of of my domain servers, one of the attributes I'm collecting is LastLogontimeStamp. The format of this timestamp is 30/11/2019 02:26:10 (or dd/MM/yyyy HH:mm:ss)

When attempting to sort by date, it sorts by the leading day (dd) digits and not by year, so its not sorting by date correctly.

Heres the excerpt of the col_types I'm using: col_type: [ 'string', 'string', 'string', {type: 'date', locale:'en-GB',format:['{dd}/{MM}/{yyyy} {HH}:{mm}:{ss}']}, 'string' ],

Is there an issue with this date/time format that stops it sorting correctly? Or am i writing my date format code incorrectly?

koalyptus commented 4 years ago

@Guyver1wales ensure the property in the configuration is col_types and not col_type as pasted above.

koalyptus commented 4 years ago

closing as no feedback, let me know @Guyver1wales if needs to be re-opened