summaryrefslogtreecommitdiffstats
path: root/client/components/cards/cardDate.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/cards/cardDate.js')
-rw-r--r--client/components/cards/cardDate.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js
index c4b5c6d8..9b2268e9 100644
--- a/client/components/cards/cardDate.js
+++ b/client/components/cards/cardDate.js
@@ -386,3 +386,30 @@ CardEndDate.register('cardEndDate');
return this.date.get().format('l');
}
}.register('minicardEndDate'));
+
+class VoteEndDate extends CardDate {
+ onCreated() {
+ super.onCreated();
+ const self = this;
+ self.autorun(() => {
+ self.date.set(moment(self.data().getVoteEnd()));
+ });
+ }
+ classes() {
+ const classes = 'end-date' + ' ';
+ return classes;
+ }
+ showDate() {
+ return this.date.get().format('l LT');
+ }
+ showTitle() {
+ return `${TAPi18n.__('card-end-on')} ${this.date.get().format('LLLL')}`;
+ }
+
+ events() {
+ return super.events().concat({
+ 'click .js-edit-date': Popup.open('editVoteEndDate'),
+ });
+ }
+}
+VoteEndDate.register('voteEndDate');