Hey everyone, I'm new to using AngularJS and I am currently attempting to incorporate one ng-module
value into another ng-module date input
within AngularJS. For example: if the date is 17-08-2016 and we add 20 days, the expected result should be 03-09-2016.
Here is my plunk for reference.
I am struggling to identify where I went wrong and how to find a solution. If anyone here has insight or knows the answer, I would greatly appreciate your help. Thank you.
This is My Controller:
$scope.name = {
"_id": "57ac1b6d82e1c5940ac3c730",
"user": {
"_id": "57400c32bd07906c1308e2cf",
"displayName": "mani selvam"
},
"__v": 0,
"terms": "20",
"invoice_date": "2016-08-17",
"due_date": ""
};
Date.prototype.addDays = function(days) {
this.setDate(this.getDate() + parseInt(terms));
return this;
};
This is My HTML:
<tr ng-repeat="mani in name"> </tr>
<td >{{name.invoice_date | date:'dd-MM-yyyy'}}</td>
<td >{{name.terms }}</td>
<td >{{name.invoice_date | date:'dd-MM-yyyy'}} + {{name.terms }}</td>