Closed bfalzarano closed 7 years ago
ok so this appears to work : )
<div class='item' ion-datetime-picker am-pm only-valid="{'between': {'initial': 'today', 'final': maxDate}, 'inclusive': true}" title="'From Date/Time'" ng-model="event.fromDate">
controller.js
//maxDate set to 180 days from today
$scope.maxDate = new Date(new Date().setDate(new Date().getDate()+180));
Hi, sure, you have to use valid javascript/angular expression there, including the "variable reference". I'm glad you worked it out yourself :)
Hi,
using between how can I set a calculated max date ($scope.maxDate calculated and set in the controller) for the final value? 'final': 'maxDate' or 'final': '{{maxDate}}' is not working.
e.g.
<div class='item' ion-datetime-picker am-pm only-valid="{'between': {'initial': 'today', 'final': 'maxDate'}, 'inclusive': true}" title="'From Date/Time'" ng-model="event.fromDate">
controller.js