From 728616ff90aa4e8788ff42053f3b839836ac2d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Thu, 24 Sep 2020 08:46:18 +0200 Subject: [PATCH] date shortcuts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Röhrl --- src/components/card/CardSidebar.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index 0b88fb2af..ad247a295 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -120,6 +120,7 @@ :lang="lang" :format="format" :disabled="saving || !canEdit" + :shortcuts="shortcuts" confirm /> @@ -299,6 +300,23 @@ export default { stringify: this.stringify, 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: {