Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo UI Grid -- Sort date as string

I'm using kendo UI, and I am looking to default sort date, but can't figure out how to modify this. In this moment kendo sort date as string and i need sort date correctly. when do i can the sort date?

like image 339
Barcalo Avatar asked Dec 09 '25 06:12

Barcalo


1 Answers

In your model you need to declare which one is a date, eg.

model: {
       id: "Id",
       fields: {
               Id: {},
               Date: { type: "date" },
               Day: {},
               Shift: {}                        
               }
       }

And when you declare column it should be something like this;

columns:
    [
        { field: "Date", format: "{0:dd/MM/yyyy}" },
        { field: "Day" },
        { field: "Shift" }
    ]

Hope this helps.

like image 171
Mahib Avatar answered Dec 12 '25 04:12

Mahib



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!