summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-11-04 09:52:31 +0200
committerGitHub <noreply@github.com>2019-11-04 09:52:31 +0200
commit9a468dfce53db3f5183df22183718d356fc9ad1d (patch)
tree386a6b2e253b8ca433c9065c68946f8034363e50
parentdb3476c8ec2ec83a648bf6028df877b4de122ba9 (diff)
parent7a5401d5f09fc888c02defb189a6a70f9b2725ab (diff)
downloadwekan-9a468dfce53db3f5183df22183718d356fc9ad1d.tar.gz
wekan-9a468dfce53db3f5183df22183718d356fc9ad1d.tar.bz2
wekan-9a468dfce53db3f5183df22183718d356fc9ad1d.zip
Merge pull request #2779 from bandresen/cardDate_receivedAtfix_and_endDatechange
Card date received-date fix and end-date coloring change (simplify)
-rw-r--r--client/components/cards/cardDate.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js
index 6634ee1b..a298fbab 100644
--- a/client/components/cards/cardDate.js
+++ b/client/components/cards/cardDate.js
@@ -237,7 +237,7 @@ class CardReceivedDate extends CardDate {
const theDate = this.date.get();
// if dueAt, endAt and startAt exist & are > receivedAt, receivedAt doesn't need to be flagged
if (
- (startAt && theDate.isAfter(dueAt)) ||
+ (startAt && theDate.isAfter(startAt)) ||
(endAt && theDate.isAfter(endAt)) ||
(dueAt && theDate.isAfter(dueAt))
)
@@ -344,9 +344,9 @@ class CardEndDate extends CardDate {
let classes = 'end-date' + ' ';
const dueAt = this.data().getDue();
const theDate = this.date.get();
- if (theDate.diff(dueAt, 'days') >= 2) classes += 'long-overdue';
- else if (theDate.diff(dueAt, 'days') >= 0) classes += 'due';
- else if (theDate.diff(dueAt, 'days') >= -2) classes += 'almost-due';
+ if (!dueAt) classes += ''
+ else if (theDate.isBefore(dueAt)) classes += 'current'
+ else if (theDate.isAfter(dueAt)) classes += 'due'
return classes;
}