diff options
author | Nico <paetni1@gmail.com> | 2020-05-03 00:33:15 +0200 |
---|---|---|
committer | Nico <paetni1@gmail.com> | 2020-05-03 00:33:15 +0200 |
commit | 3cc0a93e0ea2399d239923e3a89d49d93a979684 (patch) | |
tree | ad1dbb6ce522229d18388bb1d45cb287d0314b07 /client/components/cards/cardDate.js | |
parent | 533bc045d06269dba2f42cdfe61817a1b3407974 (diff) | |
download | wekan-3cc0a93e0ea2399d239923e3a89d49d93a979684.tar.gz wekan-3cc0a93e0ea2399d239923e3a89d49d93a979684.tar.bz2 wekan-3cc0a93e0ea2399d239923e3a89d49d93a979684.zip |
Card vote options in new fork
Diffstat (limited to 'client/components/cards/cardDate.js')
-rw-r--r-- | client/components/cards/cardDate.js | 27 |
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'); |