This is a migrated thread and some comments may be shown as answers.

Kendo Grid Date format Issue

3 Answers 155 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Siddhartha
Top achievements
Rank 1
Siddhartha asked on 30 May 2014, 03:22 PM
Hi,

We are using the Kendo grid for angular, we are having issue with the date format -
We have tried below 2 ways and neither works:
          $scope.dbColumns = [               
                {"field": "date",
                    "sortable": true,
                    "title": "First date",
                    "template": "#= kendo.toString(dateFirst, '{0:dd-MMM-yyyy}') #"
                },                
                {
                    "field": "dueSecond",
                    "sortable": true,
                    "title": "Second date",
                    "type": "date",
                    "fomrat":"{0:dd-MMM-yyyy}"
               }];
  Both cases we get the format as => 2014-05-30T11:13:51.6006636-04:00











3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 03 Jun 2014, 07:23 AM
Hello Siddhartha,

Judging from the given description, I suspect that the dateFirst and dueSecond are not JavaScript Date objects. Thus, you will need to either parse them manually or set them as type date via the DataSource schema model definition. Here is a small test page which demonstrates the later.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
ak12345
Top achievements
Rank 1
answered on 03 Jun 2014, 02:00 PM
try this: 

kendo.toString(your_date, "yyyy/MM/dd");

Replace "yyyy/MM/dd" with your required format
0
Siddhartha
Top achievements
Rank 1
answered on 10 Jun 2014, 09:22 PM
This is what worked for us - #= kendo.toString(kendo.parseDate(date, 'yyyy-MM-dd'), 'M/d/yyyy') #
Tags
Grid
Asked by
Siddhartha
Top achievements
Rank 1
Answers by
Rosen
Telerik team
ak12345
Top achievements
Rank 1
Siddhartha
Top achievements
Rank 1
Share this question
or