I have a Date of Birth field in the form.
It currently defaults to today's date.
The customer has requested that instead starting off showing the month view, that it start by showing the century, then select decade, then select year, then month, and then show the month view.
So basically he wants to to start the screen off in the screenshot I've shown attached to this this threat.
Basically I need it to work opposite what it currently does, where it starts off with month view, then go back to year view, then decade view, then century view.
It currently defaults to today's date.
The customer has requested that instead starting off showing the month view, that it start by showing the century, then select decade, then select year, then month, and then show the month view.
So basically he wants to to start the screen off in the screenshot I've shown attached to this this threat.
Basically I need it to work opposite what it currently does, where it starts off with month view, then go back to year view, then decade view, then century view.
6 Answers, 1 is accepted
0
Hello Matthew,
You could achieve this with the start configuration option of the widget. Here is a runnable example, which demonstrates it in action.
I wish you a great day!
Regards,
Dimiter Madjarov
Telerik
You could achieve this with the start configuration option of the widget. Here is a runnable example, which demonstrates it in action.
I wish you a great day!
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Matt
Top achievements
Rank 1
answered on 07 Aug 2014, 01:47 PM
Perfect! I need it to default to last century though, not this one. Very few people have a birthday in the 21th Century.
0
Accepted
Hello Matthew,
The reason for this behavior is that the current property of the DatePicker is set to today's date, because there is no value specified. A sample workaround would be use the open event of the DatePicker, access the Calendar and set it's value to a date in the desired century. Here is the updated example.
Regards,
Dimiter Madjarov
Telerik
The reason for this behavior is that the current property of the DatePicker is set to today's date, because there is no value specified. A sample workaround would be use the open event of the DatePicker, access the Calendar and set it's value to a date in the desired century. Here is the updated example.
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Matt
Top achievements
Rank 1
answered on 11 Aug 2014, 04:00 PM
I'm getting the following error:
TypeError: $(...).data(...) is undefined$(".birthDatePicker").data("kendoDatePicker").one("open", function(){ this.dateV...
This is how my code looks.
$(".birthDatePicker").kendoDatePicker({ start: "century" });
$(".birthDatePicker").data("kendoDatePicker").one("open", function(){ this.dateView.calendar.value(new Date(1990, 1, 1))});
TypeError: $(...).data(...) is undefined$(".birthDatePicker").data("kendoDatePicker").one("open", function(){ this.dateV...
This is how my code looks.
$(".birthDatePicker").kendoDatePicker({ start: "century" });
$(".birthDatePicker").data("kendoDatePicker").one("open", function(){ this.dateView.calendar.value(new Date(1990, 1, 1))});
0

Matt
Top achievements
Rank 1
answered on 11 Aug 2014, 04:05 PM
Nevermind, I got it to work by doing this:
$(".birthDatePicker").kendoDatePicker({ start: "century" }).data("kendoDatePicker").one("open", function(){ this.dateView.calendar.value(new Date(1990, 1, 1))});
$(".birthDatePicker").kendoDatePicker({ start: "century" }).data("kendoDatePicker").one("open", function(){ this.dateView.calendar.value(new Date(1990, 1, 1))});
0
Hello Matthew,
I am glad the issue is resolved.
Have a nice day!
Regards,
Dimiter Madjarov
Telerik
I am glad the issue is resolved.
Have a nice day!
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!