Order by date descending does not work ?

Order by date descending does not work ?

ameridianameridian Posts: 1Questions: 1Answers: 0

Link to test case:

https://imgur.com/a/4iGMYev

Debugger code (debug.datatables.net):
$('.VerticallScroll').DataTable();

@foreach (ASK sk in ASK) { }
Pret Cantitate Data
@sk.Price @sk.Quantity @sk.CreatedOn

Error messages shown:
Data is not sorted in descending order
Description of problem:
I have some data in a table that I want to sort in descending order by date.The issue is that the sorting does not work as is supposed to work,as you can see in the pic i uploaded in the link.I guess is because of the data type,but I do not know how to fix it.

Answers

  • rf1234rf1234 Posts: 2,806Questions: 85Answers: 406
    edited May 2020

    https://datatables.net/blog/2014-12-18

    the plugin plus moment.js plus your respective locale file (your language).

    There are very many threads on this in the forum. This question has been asked so many times. Search the forum please.

    This is from my own coding. Should be pretty much like what you require. Maybe change the sequence of month and day and remove the '@' sign.

    $.fn.dataTable.moment('DD/MM/YYYY, @ hh:mm:ss A');

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394

    For future reference, a screen-shot is not a test case.

This discussion has been closed.