sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve
asked on 12 Oct 2012, 03:12 PM
December 18th has a data-value of 18-11-12 instead of 18-12-12, why is that?
4 Answers, 1 is accepted
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 15 Oct 2012, 07:44 PM
kendo.parseDate also seems to not adjust for the 0 index...
0
Hello Steve,
Atanas Korchev
the Telerik team
We don't understand what you mean. Any example?
Kind regards,Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 16 Oct 2012, 12:15 PM
Sure,
http://demos.kendoui.com/web/calendar/index.html
Inspect the data-value of any date in the calendar
Should be 2012/10/16 not 2012/9/16
So I was hoping your date helpers in kendo would adjust it back, but no?
http://demos.kendoui.com/web/calendar/index.html
Inspect the data-value of any date in the calendar
<
a
title
=
"Tuesday, October 16, 2012"
data-value
=
"2012/9/16"
href
=
"#"
class
=
"k-link"
>16</
a
>
Should be 2012/10/16 not 2012/9/16
So I was hoping your date helpers in kendo would adjust it back, but no?
0
Hello Steve,
is zero based. We split the value by "/" separator and create Date object from the values:
I believe that the comment in the code snippet is expressive enough.
The kendo.parseDate expects string value, which has non zero based month. The Date.parse method works in the same way. If you need to use data-value of the cell, then you can use the above code snippet.
Regards,
Georgi Krustev
the Telerik team
The value of the data attribute:
data-value="2012/9/16"
var
value = link.attr(kendo.attr(VALUE)).split(
"/"
);
//Safari cannot create correct date from "1/1/2090"
value =
new
DATE(value[0], value[1], value[2]);
The kendo.parseDate expects string value, which has non zero based month. The Date.parse method works in the same way. If you need to use data-value of the cell, then you can use the above code snippet.
Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!