2
0
Эх сурвалжийг харах

Adjust classes given to due date to take into account end date

RJevnikar 7 жил өмнө
parent
commit
45cf2843a6

+ 6 - 3
client/components/cards/cardDate.js

@@ -279,11 +279,14 @@ class CardDueDate extends CardDate {
 
   classes() {
     let classes = 'due-date' + ' ';
-    if (this.now.get().diff(this.date.get(), 'days') >= 2)
+    if ((this.now.get().diff(this.date.get(), 'days') >= 2) &&
+       (this.date.get().isBefore(this.data().endAt)))
       classes += 'long-overdue';
-    else if (this.now.get().diff(this.date.get(), 'minute') >= 0)
+    else if ((this.now.get().diff(this.date.get(), 'minute') >= 0) &&
+       (this.date.get().isBefore(this.data().endAt)))
       classes += 'due';
-    else if (this.now.get().diff(this.date.get(), 'days') >= -1)
+    else if ((this.now.get().diff(this.date.get(), 'days') >= -1) &&
+       (this.date.get().isBefore(this.data().endAt)))
       classes += 'almost-due';
     return classes;
   }