Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ToDoItem.prototype.toString = function() {
- let mm = this.dueDate.getMonth() + 1;
- let dd = this.dueDate.getDate();
- if (this.finishedDate === undefined) {
- return ' ' + this.text + ' ' + mm + '/' + dd + '/' + this.dueDate.getFullYear();
- } if (this.finishedDate <= this.dueDate) {
- let mm1 = this.finishedDate.getMonth() + 1;
- let dd1 = this.finishedDate.getDate();
- return ' ' + this.text + ' ' + mm + '/' + dd + '/' + this.dueDate.getFullYear() + ' ' + mm1 + '/' + dd1 + '/' + this.finishedDate.getFullYear();
- }if (this.finishedDate > this.dueDate) {
- let mm2 = this.finishedDate.getMonth() + 1;
- let dd2 = this.finishedDate.getDate();
- return '* ' + this.text + ' ' + mm + '/' + dd + '/' + this.dueDate.getFullYear() + ' ' + mm2 + '/' + dd2 + '/' + this.finishedDate.getFullYear();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement