about datetime sorting
about datetime sorting
yu yen kan
Posts: 65Questions: 31Answers: 0
I am using $.fn.dataTable.moment('YYYY MMMM DD HH:mm:ss');
in code to sort the datetime and my datetime output is 2017 February 28 23:19
.
the result is something wrong, when ascending it sort to
2017 February 28 23:19
2017 July 27 19:12
2017 March 20 05:01
This discussion has been closed.
Replies
Check your usage of moment formatting. It looks like 'MMMM' means show the month in words, so you end up sorting a string.
You have
:ss
in your string format, but no seconds in your data - hence it won't work.Allan
what if I have multiple datatime field with different format? how can I do it with that?
With that plug-in you simply define each format and it will automatically find it:
Allan