I am now using the plain HTML5-style datepicker by adding type="date"
to the input-element. This looks good and works with picking dates and using them. But I want to be able to set the value of the datepicker programmatically, to enforce ranges the user is able to choose from.
The element now looks like this:
<input type="date"
placeholder="Choose startdate"
ng-model="rangeStart"
ng-change="changeRangeStart(rangeStart)"
>
There is also a button to reset the date to today, for example. This is how I try to do that:
// today is a Date-object
$scope.rangeStart = today;
EDIT// ^ changed rangeEnd to rangeStart (typo)
Anyone who can help me with this? Now the user can set the date, but I want to be able to change the date for the user.