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

Set k-min to other controls value (Angular)

3 Answers 162 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Elliot
Top achievements
Rank 1
Elliot asked on 16 Jun 2015, 03:13 PM

I have two date pickers and want to set the min of the second equal to the value of the first however it is not applying the restriction.  Here are my two pickers:

<input id="fromDate" name="toDate" kendo-date-picker k-ng-model="vm.fromDate" placeholder="From Date" />

<input id="toDate" name="toDate" kendo-date-picker k-ng-model="vm.toDate" k-min="vm.fromDate" placeholder="To Date" />

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 18 Jun 2015, 12:53 PM
Hi,

If you want to update the widget when options change you will need to use a special directive. It is explained here:

http://docs.telerik.com/kendo-ui/AngularJS/introduction#updating-widgets-when-options-change

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Elliot
Top achievements
Rank 1
answered on 18 Nov 2015, 06:59 PM

I am still having an issue with this.  The link above no longer works but I did read the section on k-rebind and have added it to the toDate field but am getting a Uncaught TypeError: Cannot read property 'getMonth' of null error when it brings up the calendar on that field.

The toDate input now looks like:

<input id="toDate" name="toDate" kendo-date-picker k-ng-model="vm.toDate" k-min="vm.fromDate" k-rebind="vm.fromDate" placeholder="To Date" />

How can I use k-min using another date pickers value?

0
Kiril Nikolov
Telerik team
answered on 19 Nov 2015, 07:31 AM
Hi Elliot,

The following k-rebind example seems to be working correctly:

http://dojo.telerik.com/AneQe

On a side note you can update the min setting using the widget API as well:


http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-min

Regards,
Kiril Nikolov
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
Elliot
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Elliot
Top achievements
Rank 1
Share this question
or