Topic: datatable sort datetime

qbecker priority asked 1 year ago

Hi, I am sorting a datatable by a date time field like "10-26-2022 01:00 PM".

It seems like it may be treating it like a string and sorting it that way. Is there a way for me to sort by date time on the datatables?

Grzegorz Bujański staff answered 1 year ago

At the moment all fields are sorted according to the format you pass. If you pass it as a string, it will be sorted as a string. Passing this value in the Date format will cause correct sorting, but unfortunately it is not possible to change the format of the displayed data.

We are planning to create a more extensive datatable, but unfortunately at the moment I am not able to give an approximate release date.

qbecker priority commented 1 year ago

What is the currently supported date format?

Grzegorz Bujański staff commented 1 year ago

If you are passing the date as a sring, the best way to get the sort to work properly is to use the 24h format - YYYY/MM/DD HH:MM

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 5.0.0
  • Device: pc
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No