date shortcuts

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2020-09-24 08:46:18 +02:00
parent e360f4f9d9
commit 728616ff90

View File

@@ -120,6 +120,7 @@
:lang="lang" :lang="lang"
:format="format" :format="format"
:disabled="saving || !canEdit" :disabled="saving || !canEdit"
:shortcuts="shortcuts"
confirm /> confirm />
<Actions v-if="canEdit"> <Actions v-if="canEdit">
<ActionButton v-if="copiedCard.duedate" icon="icon-delete" @click="removeDue()"> <ActionButton v-if="copiedCard.duedate" icon="icon-delete" @click="removeDue()">
@@ -299,6 +300,23 @@ export default {
stringify: this.stringify, stringify: this.stringify,
parse: this.parse, parse: this.parse,
}, },
shortcuts: [
{
text: 'Today',
onClick() {
const date = new Date()
return date
},
},
{
text: 'Tomorrow',
onClick() {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24)
return date
},
},
],
} }
}, },
computed: { computed: {