hienvd
hienvd

Reputation: 346

Sort Date in a specific format in EXTJS

I have a Date column in a Ext JS grid with its display format like: "Jan 22,2014 08:43:21". My problem is how to sort with this format, currently it is sorted follow String format.

Example, when I have 2 rows with corresponding values are:

"Jan 22,2014 08:43:21" 
"Nov 20,2013 08:43:21"

My expectation after sorting ASC is that the second row will be showed first, cause 20/11/2013 is before 22/01/2014, but it is sorting by String format, so the result is incorrect.

Could you please help me on this? Thank you very much.

Upvotes: 0

Views: 1745

Answers (1)

newmount
newmount

Reputation: 1951

One way of doing that is to use sorterFn, fiddle here: https://fiddle.sencha.com/#fiddle/2u7

Upvotes: 1

Related Questions