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

Why value is not set correctly

1 Answer 88 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Ilya
Top achievements
Rank 1
Ilya asked on 11 Mar 2016, 11:17 AM

Why this code does not set the value to input element?

 

<input id="datePicker" /><script> $(document).ready(function(){ $("#datePicker").kendoDatePicker({ value: new Date(), min: new Date()})});</script><button>SetNewValue</button><script> $('button').on('click',function(){var dp = $("#datePicker").data('kendoDatePicker'); dp.value(new Date(2016,1,1))})</script>

 

 

If I change date to "new Date(2016, 4, 1)" value will be set correctly. The error appears in all browsers.
Link to JSbin example http://jsbin.com/catolumifa/edit?html,output

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 11 Mar 2016, 03:11 PM
Hello Ilya,

I have examined the sample and noticed that the min date is set as the current date. If you remove the min property the date will be set as expected. Check out the modified version below.



Regards,
Viktor Tachev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Date/Time Pickers
Asked by
Ilya
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or