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

DatePicker is not showing the date after selection

4 Answers 578 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Kickinmhl
Top achievements
Rank 1
Kickinmhl asked on 27 Mar 2013, 04:43 PM
It is the first time I am attempting to use the DatePicker, so excuse me in advance if I am just missing something basic, but here is the scenario.

I am using a basic datePicker with a min and max value: (by the way, if I remove the min and max, i have the same problem)

    var periodDays = modelFromServer.DaysInPeriod.length;
    $("#dayPicker").kendoDatePicker({
        min: new Date(modelFromServer.DaysInPeriod[0].Date),
        max: new Date(modelFromServer.DaysInPeriod[periodDays - 1].Date)
    });

When I select a day in the calendar, I would expect that day to show up in text next to the picker, but I have not been able to get it to show up there.  How do you set the displayed date?  See attached image for the picker.

If I break and look at the value of   $("#dayPicker").data("kendoDatePicker").value()  i get the proper date that I selected.  It just won't fill in the text field next to the calendar icon.

Any idea what I am doing wrong?

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 29 Mar 2013, 09:37 AM
Hello,

 
I prepared a simple jsBin demo in my attempt to replicate the issue, but to no avail. Let me know if I am missing something.

All the best,
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!
0
James
Top achievements
Rank 1
answered on 25 Feb 2014, 04:58 PM
This has probably already been resolved, however, here is one possible solution.

If you used
<div ID/Class="yourelement"></div>
instead of
<input id/class="yourelement" />
The date will not show up in the Text area.
0
Georgi Krustev
Telerik team
answered on 26 Feb 2014, 02:47 PM
Hello James,

The DatePicker widget can only be initialized from an INPUT element. I will suggest you check the DatePicker Getting Started help topic, where you can find more information about the widget initialization.

Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
James
Top achievements
Rank 1
answered on 26 Feb 2014, 03:19 PM
Yes,  I am aware, but thank you.
I was just offering a reason for anyone else who came across this post if they were running into the same issue as @Kickinmhl.

That using a <Div> instead of an <input> would cause what he saw.

Thank you for clarifying though.
Tags
Date/Time Pickers
Asked by
Kickinmhl
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
James
Top achievements
Rank 1
Share this question
or