From be507e567a48c0cefef5a472fc73ce0d2dafa82c Mon Sep 17 00:00:00 2001 From: Daniel Kreuter Date: Fri, 25 May 2018 19:44:49 +0200 Subject: Extend editCardReceivedDatePopup and editCardEndDatePopup from DatePicker to fix #1654 --- client/components/cards/cardDate.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'client/components/cards/cardDate.js') diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js index f33e8c19..52a48f47 100644 --- a/client/components/cards/cardDate.js +++ b/client/components/cards/cardDate.js @@ -93,7 +93,7 @@ Template.dateBadge.helpers({ }); // editCardReceivedDatePopup -(class extends EditCardDate { +(class extends DatePicker { onCreated() { super.onCreated(); this.data().receivedAt && this.date.set(moment(this.data().receivedAt)); @@ -156,7 +156,7 @@ Template.dateBadge.helpers({ }).register('editCardDueDatePopup'); // editCardEndDatePopup -(class extends EditCardDate { +(class extends DatePicker { onCreated() { super.onCreated(); this.data().endAt && this.date.set(moment(this.data().endAt)); @@ -355,4 +355,3 @@ CardEndDate.register('cardEndDate'); return this.date.get().format('l'); } }).register('minicardEndDate'); - -- cgit v1.2.3-1-g7c22 From 45cf2843a63e96eefc5174dd55cf540c9b74c3a9 Mon Sep 17 00:00:00 2001 From: RJevnikar <12701645+rjevnikar@users.noreply.github.com> Date: Fri, 8 Jun 2018 21:09:52 +0000 Subject: Adjust classes given to due date to take into account end date --- client/components/cards/cardDate.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'client/components/cards/cardDate.js') diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js index 52a48f47..e95c3a23 100644 --- a/client/components/cards/cardDate.js +++ b/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; } -- cgit v1.2.3-1-g7c22