summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-08-02 00:55:08 +0300
committerLauri Ojansivu <x@xet7.org>2018-08-02 00:55:08 +0300
commitafeb2de412f120e28d8bc081e12c4380949ffb93 (patch)
treee741220a49ec5da2e9e0fedf2a53bf4d909fa46d
parentda6c2b5503f08deba63421606ae7c09bc8f95763 (diff)
parent83d6ef7301cb7b5c68dca77f976f4be5839b972e (diff)
downloadwekan-afeb2de412f120e28d8bc081e12c4380949ffb93.tar.gz
wekan-afeb2de412f120e28d8bc081e12c4380949ffb93.tar.bz2
wekan-afeb2de412f120e28d8bc081e12c4380949ffb93.zip
Merge branch 'rjevnikar-dateCSS' into devel
-rw-r--r--CHANGELOG.md7
-rw-r--r--client/components/cards/cardDate.js60
-rw-r--r--client/components/cards/cardDate.styl4
-rw-r--r--client/components/cards/cardDetails.jade14
4 files changed, 45 insertions, 40 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5282a350..67be920c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,11 +2,12 @@
This release fixes the following bugs:
-- [Enable Wekan API by default, so that Export Board to JSON works](https://github.com/wekan/wekan/commit/b2eeff96977592deaeb23a8171fc3b13f8c6c5dc).
+- [Enable Wekan API by default, so that Export Board to JSON works](https://github.com/wekan/wekan/commit/b2eeff96977592deaeb23a8171fc3b13f8c6c5dc);
+- [Fix the flagging of dates](https://github.com/wekan/wekan/pull/1814).
-Thanks to GitHub user xet7 for contributions.
+Thanks to GitHub users rjevnikar and xet7 for their contributions.
-# v1.23 2018-07-30
+# v1.23 2018-07-30 Wekan release
This release tries to fix the following bugs:
diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js
index b0f2baa3..831a0f39 100644
--- a/client/components/cards/cardDate.js
+++ b/client/components/cards/cardDate.js
@@ -220,12 +220,16 @@ class CardReceivedDate extends CardDate {
classes() {
let classes = 'received-date ';
const dueAt = this.data().dueAt;
- if (dueAt) {
- if (this.date.get().isBefore(this.now.get(), 'minute') &&
- this.now.get().isBefore(dueAt)) {
- classes += 'current';
- }
- }
+ const endAt = this.data().endAt;
+ const startAt = this.data().startAt;
+ 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))) ||
+ ((endAt) && (theDate.isAfter(endAt))) ||
+ ((dueAt) && (theDate.isAfter(dueAt))))
+ classes += 'long-overdue';
+ else
+ classes += 'current';
return classes;
}
@@ -253,12 +257,17 @@ class CardStartDate extends CardDate {
classes() {
let classes = 'start-date' + ' ';
const dueAt = this.data().dueAt;
- if (dueAt) {
- if (this.date.get().isBefore(this.now.get(), 'minute') &&
- this.now.get().isBefore(dueAt)) {
- classes += 'current';
- }
- }
+ const endAt = this.data().endAt;
+ const theDate = this.date.get();
+ const now = this.now.get();
+ // if dueAt or endAt exist & are > startAt, startAt doesn't need to be flagged
+ if (((endAt) && (theDate.isAfter(endAt))) ||
+ ((dueAt) && (theDate.isAfter(dueAt))))
+ classes += 'long-overdue';
+ else if (theDate.isBefore(now, 'minute'))
+ classes += 'almost-due';
+ else
+ classes += 'current';
return classes;
}
@@ -286,17 +295,15 @@ class CardDueDate extends CardDate {
classes() {
let classes = 'due-date' + ' ';
- // if endAt exists & is < dueAt, dueAt doesn't need to be flagged
const endAt = this.data().endAt;
const theDate = this.date.get();
const now = this.now.get();
-
- if ((endAt !== 0) &&
- (endAt !== null) &&
- (endAt !== '') &&
- (endAt !== undefined) &&
- (theDate.isBefore(endAt)))
+ // if the due date is after the end date, green - done early
+ if ((endAt) && (theDate.isAfter(endAt)))
classes += 'current';
+ // if there is an end date, don't need to flag the due date
+ else if (endAt)
+ classes += '';
else if (now.diff(theDate, 'days') >= 2)
classes += 'long-overdue';
else if (now.diff(theDate, 'minute') >= 0)
@@ -330,15 +337,12 @@ class CardEndDate extends CardDate {
classes() {
let classes = 'end-date' + ' ';
const dueAt = this.data.dueAt;
- if (dueAt) {
- const diff = dueAt.diff(this.date.get(), 'days');
- if (diff >= 2)
- classes += 'long-overdue';
- else if (diff > 0)
- classes += 'due';
- else if (diff <= 0)
- classes += 'current';
- }
+ const theDate = this.date.get();
+ // if dueAt exists & is after endAt, endAt doesn't need to be flagged
+ if ((dueAt) && (theDate.isAfter(dueAt, 'minute')))
+ classes += 'long-overdue';
+ else
+ classes += 'current';
return classes;
}
diff --git a/client/components/cards/cardDate.styl b/client/components/cards/cardDate.styl
index 9775e82b..62cfdcd9 100644
--- a/client/components/cards/cardDate.styl
+++ b/client/components/cards/cardDate.styl
@@ -43,12 +43,12 @@
&.start-date
time
&::before
- content: "\f08b" // symbol: fa-sign-out
+ content: "\f251" // symbol: fa-hourglass-start
&.received-date
time
&::before
- content: "\f251" // symbol: fa-hourglass-start
+ content: "\f08b" // symbol: fa-sign-out
time
&::before
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index aaad7c7c..34dbc117 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -38,13 +38,6 @@ template(name="cardDetails")
else
a.js-start-date {{_ 'add'}}
- .card-details-item.card-details-item-due
- h3.card-details-item-title {{_ 'card-due'}}
- if dueAt
- +cardDueDate
- else
- a.js-due-date {{_ 'add'}}
-
.card-details-item.card-details-item-end
h3.card-details-item-title {{_ 'card-end'}}
if endAt
@@ -52,6 +45,13 @@ template(name="cardDetails")
else
a.js-end-date {{_ 'add'}}
+ .card-details-item.card-details-item-due
+ h3.card-details-item-title {{_ 'card-due'}}
+ if dueAt
+ +cardDueDate
+ else
+ a.js-due-date {{_ 'add'}}
+
.card-details-items
.card-details-item.card-details-item-members
h3.card-details-item-title {{_ 'members'}}