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

Date format US to FR

4 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nicolas
Top achievements
Rank 1
Nicolas asked on 03 Sep 2015, 03:10 PM

Hi,

I'm taking a lot of caution to display date in right format, but dispite of this it doesn't still work.

In grid columns definition :

1.columns : [
2....
3. { field: "date", title: "At", type: "date", format: "{0: dd/MM/yyyy}"}
4....
5.]

My datasource :

01....
02.dataSource: new kendo.data.DataSource({
03.                            data: [{id:1,date:moment().format("DD/MM/YYYY")}],
04.                            schema: {
05.                                model: {
06.                                    id: "id",
07.                                    fields: {
08.                                        ...
09.                                        date: {type: "date", format: "dd/MM/yyyy"},
10.                                        ...
11.                                    }
12.                                }
13.                            },
14.                            sort: {field: "date", dir: "asc"}
15.                        })

 

 Setting general kendo culture.

1.kendo.culture("fr-FR");

 

And my grid :

 

<div kendo-grid="kgrid" k-data-source="...dataSource" k-options="myoptions"></div>

 

Thanks in advance for your tips !

4 Answers, 1 is accepted

Sort by
0
Nicolas
Top achievements
Rank 1
answered on 03 Sep 2015, 03:14 PM

I forgot to describe the result obtained and expected :

 The grid display date with MM/DD/YYYY and I would like to get DD/MM/YYYY format

0
Konstantin Dikov
Telerik team
answered on 04 Sep 2015, 11:57 AM
Hi Nicolas,

When the field that you need to display in a date column is Date type, setting the format property of the column should be enough for changing the displayed format. For your convenience, following is a simple example demonstrating such approach:
If any further assistance is needed, please prepare a dojo example that replicates the issue, so we can test it locally.


Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Nicolas
Top achievements
Rank 1
answered on 13 Oct 2015, 01:02 PM

Hi Konstantin,

Thanks for your answer, I'm back on this subject. Dojo doesn't run for me

If I don't set date schema model when I ​get a new datasource, the date is well displayed but when I edit the cell it's just a text field without date selector.... It becomes a big problem for us.

0
Konstantin Dikov
Telerik team
answered on 15 Oct 2015, 07:11 AM
Hello Nicolas,

Following is the working dojo example (not sure why the previous one was changed):
Once again, in order for us to be able to assist you on this matter, please isolate the problem in a dojo example, so we can have a better idea on your exact scenario.


Best Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Nicolas
Top achievements
Rank 1
Answers by
Nicolas
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or