summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorRJevnikar <12701645+rjevnikar@users.noreply.github.com>2018-06-13 22:18:00 +0000
committerRJevnikar <12701645+rjevnikar@users.noreply.github.com>2018-06-13 22:18:00 +0000
commit67454d0491ca17e61eb50034ecb5d03c85dd5abe (patch)
treeba489eda37cdac117f412311cfc020d199832ce7 /client/components
parent848d8ac95d810bfedf1150c79341861e4a8157ce (diff)
downloadwekan-67454d0491ca17e61eb50034ecb5d03c85dd5abe.tar.gz
wekan-67454d0491ca17e61eb50034ecb5d03c85dd5abe.tar.bz2
wekan-67454d0491ca17e61eb50034ecb5d03c85dd5abe.zip
Fix data colour changes on cards.
Addressing both #1685 and #1693
Diffstat (limited to 'client/components')
-rw-r--r--client/components/cards/cardDate.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js
index e95c3a23..83cc1424 100644
--- a/client/components/cards/cardDate.js
+++ b/client/components/cards/cardDate.js
@@ -279,14 +279,18 @@ class CardDueDate extends CardDate {
classes() {
let classes = 'due-date' + ' ';
- if ((this.now.get().diff(this.date.get(), 'days') >= 2) &&
+ // if endAt exists & is < dueAt, dueAt doesn't need to be flagged
+ if ((this.data().endAt != 0) &&
+ (this.data().endAt != null) &&
+ (this.data().endAt != '') &&
+ (this.data().endAt != undefined) &&
(this.date.get().isBefore(this.data().endAt)))
+ classes += 'current';
+ else if (this.now.get().diff(this.date.get(), 'days') >= 2)
classes += 'long-overdue';
- else if ((this.now.get().diff(this.date.get(), 'minute') >= 0) &&
- (this.date.get().isBefore(this.data().endAt)))
+ else if (this.now.get().diff(this.date.get(), 'minute') >= 0)
classes += 'due';
- else if ((this.now.get().diff(this.date.get(), 'days') >= -1) &&
- (this.date.get().isBefore(this.data().endAt)))
+ else if (this.now.get().diff(this.date.get(), 'days') >= -1)
classes += 'almost-due';
return classes;
}
@@ -316,10 +320,10 @@ class CardEndDate extends CardDate {
let classes = 'end-date' + ' ';
if (this.data.dueAt.diff(this.date.get(), 'days') >= 2)
classes += 'long-overdue';
- else if (this.data.dueAt.diff(this.date.get(), 'days') >= 0)
+ else if (this.data.dueAt.diff(this.date.get(), 'days') > 0)
classes += 'due';
- else if (this.data.dueAt.diff(this.date.get(), 'days') >= -2)
- classes += 'almost-due';
+ else if (this.data.dueAt.diff(this.date.get(), 'days') <= 0)
+ classes += 'current';
return classes;
}