summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-06-14 18:47:26 +0300
committerLauri Ojansivu <x@xet7.org>2018-06-14 18:47:26 +0300
commitfa82efe7d24a18afbd99ba805bdc3666cf3ba863 (patch)
tree9509efbe3a10765a99e8b90e15e49d7b54fac8be /client/components
parent848d8ac95d810bfedf1150c79341861e4a8157ce (diff)
parent011fad6701720f24c293c6198fddab7f77f35dfd (diff)
downloadwekan-fa82efe7d24a18afbd99ba805bdc3666cf3ba863.tar.gz
wekan-fa82efe7d24a18afbd99ba805bdc3666cf3ba863.tar.bz2
wekan-fa82efe7d24a18afbd99ba805bdc3666cf3ba863.zip
Merge branch 'rjevnikar-dateColourFix' into devel
Fix data colour changes on cards. Related https://github.com/wekan/wekan/pull/1698 Fixes #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..c3e0524d 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;
}