From b660b3c5d63577890e22012bb90623aff22c9779 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 20 Dec 2020 22:32:46 +0800 Subject: [PATCH] set time to current time when user clear time --- src/views/mobile/transactions/Edit.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/views/mobile/transactions/Edit.vue b/src/views/mobile/transactions/Edit.vue index 80256b85..9ead7b44 100644 --- a/src/views/mobile/transactions/Edit.vue +++ b/src/views/mobile/transactions/Edit.vue @@ -391,6 +391,11 @@ export default { } }, 'transaction.time': function (newValue) { + if (!newValue) { + newValue = this.$utilities.formatDate(new Date(), 'YYYY-MM-DDTHH:mm'); + this.transaction.time = newValue; + } + this.transaction.unixTime = this.$utilities.getUnixTime(newValue); } },