Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1.  
  2. ToDoItem.prototype.toString = function() {
  3. let mm = this.dueDate.getMonth() + 1;
  4. let dd = this.dueDate.getDate();
  5.  
  6. if (this.finishedDate === undefined) {
  7. return ' ' + this.text + ' ' + mm + '/' + dd + '/' + this.dueDate.getFullYear();
  8. } if (this.finishedDate <= this.dueDate) {
  9. let mm1 = this.finishedDate.getMonth() + 1;
  10. let dd1 = this.finishedDate.getDate();
  11. return ' ' + this.text + ' ' + mm + '/' + dd + '/' + this.dueDate.getFullYear() + ' ' + mm1 + '/' + dd1 + '/' + this.finishedDate.getFullYear();
  12. }if (this.finishedDate > this.dueDate) {
  13. let mm2 = this.finishedDate.getMonth() + 1;
  14. let dd2 = this.finishedDate.getDate();
  15. return '* ' + this.text + ' ' + mm + '/' + dd + '/' + this.dueDate.getFullYear() + ' ' + mm2 + '/' + dd2 + '/' + this.finishedDate.getFullYear();
  16. }
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement