Why value is not set correctly

2 posts, 0 answers
  1. Ilya
    Ilya avatar
    1 posts
    Member since:
    Jul 2012

    Posted 11 Mar 2016 Link to this post

    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

  2. Viktor Tachev
    Viktor Tachev avatar
    1790 posts

    Posted 11 Mar 2016 Link to this post

    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.

    Viktor Tachev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top