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

Bug: Dates changes when culture is changed

0 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 06 Nov 2012, 06:29 PM
I just set up a Grid with a date column. When I change the culture to eg. danish "da-DK" the value of the date is changed.

Eg. 2012-11-05 is change from "Mon Nov 05 2012 00:00:00 GMT+0100 (Central Europe Standard Time)" to "Tue Dec 20 2011 00:00:00 GMT+0100 (Central Europe Standard Time)"

This is clearly a bug. The date from the data source is in ISO 8601 format (2012-11-05T00:00:00), and even in danish this means 5th November 2012 ;-)

This will reproduce the error:

<div id="grid"></div>
<script src="/kendoui/kendo.web.min.js"> </script>
<script src="/kendoui/cultures/kendo.culture.da-DK.min.js"> </script>

<script>
    $(document).ready(function() {
        kendo.culture("da-DK");

        $("#grid").kendoGrid({
            dataSource: {
                data: [{ "Date": "2012-11-05T00:00:00" }],
                schema: {
                    model: { fields: { Date: { type: "date" } } }
                },
            },
            columns: [{ field: "Date", width: 200 }
            ]
        });
    });
</script>

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Thomas
Top achievements
Rank 1
Share this question
or