Topic: datatable sort datetime

qbecker priority asked 2 years 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 2 years 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 2 years ago

What is the currently supported date format?


Grzegorz Bujański staff commented 2 years 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.

FREE CONSULTATION

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

Status

Answered

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