Hi
I want to build a simple “from date” and “to date” data type so in the “to date” I won’t be able to select a date that is smaller than “from date”.
I have built a package that contains two date pickers and created a new data type, and
tried listening to the scope event using $watch function, but it created an error related to $digest object.
function CompareDates(dateFromString, dateToString) {
var dateFrom = new Date(dateFromString);
var dateTo = new Date(dateToString);
if (dateTo < dateFrom) {
return false;
}
return true;
}
Date picker - From Date and To Date
Hi I want to build a simple “from date” and “to date” data type so in the “to date” I won’t be able to select a date that is smaller than “from date”.
I have built a package that contains two date pickers and created a new data type, and tried listening to the scope event using $watch function, but it created an error related to $digest object.
The controller:
The html file:
The watch function I tried, but created error in the console:
Hi - just wondering if you ever got to the bottom of this?
I managed to get a partial result with this code:
but the error message appears after the submit.
is working on a reply...