From 233c57731275d499f71baee724607bb08e11e409 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 23 Jun 2021 15:14:37 +0200 Subject: [PATCH] Use ISO8601 timestamps for the CalDAV trashbin Signed-off-by: Christoph Wurst --- package-lock.json | 2 +- src/components/AppNavigation/CalendarList/Moment.vue | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d5fde2e92..ccd63405a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6760,7 +6760,7 @@ "dev": true }, "cdav-library": { - "version": "git+https://github.com/nextcloud/cdav-library.git#b7a567e2cff9459634e6801719ad780d4a087bbd", + "version": "git+https://github.com/nextcloud/cdav-library.git#8a8d42fad2a9bc9567b353c49559438347d110ee", "from": "git+https://github.com/nextcloud/cdav-library.git", "requires": { "core-js": "^3.14.0", diff --git a/src/components/AppNavigation/CalendarList/Moment.vue b/src/components/AppNavigation/CalendarList/Moment.vue index 960edf8eb..bfa911e0a 100644 --- a/src/components/AppNavigation/CalendarList/Moment.vue +++ b/src/components/AppNavigation/CalendarList/Moment.vue @@ -9,7 +9,7 @@ export default { name: 'Moment', props: { timestamp: { - type: Number, + type: [Date, Number], required: true, }, format: { @@ -19,10 +19,16 @@ export default { }, computed: { title() { - return moment.unix(this.timestamp).format(this.format) + return moment.unix(this.numericTimestamp).format(this.format) }, formatted() { - return moment.unix(this.timestamp).fromNow() + return moment.unix(this.numericTimestamp).fromNow() + }, + numericTimestamp() { + if (this.timestamp instanceof Date) { + return this.timestamp.getTime() / 1000 + } + return this.timestamp }, }, }