I'd like to create a custom AngularJS filter using dates but in first my filter doesn't work...
app.filter('calculEndDate', function() {
// here I want to add "duration" to the date
// month or year according to "durationType"
return function(date) {
return date;
}
});
<select ng-model="durationType">
<option>month</option>
<option>year</option>
</select>
<input type="number" ng-model="duration">
<label for="startDate">startDate</label>
<input type="text" ng-model="startDate">
<input type="text" ng-value="startDate | calculEndDate">
My main issue : endDate is null and I don't know how to proceed to apply my filter when startDate is not empty..