Merge pull request #3251 from nextcloud/chore/caldav-trashbin-iso-timestamps

Use ISO8601 timestamps for the CalDAV trashbin
This commit is contained in:
Christoph Wurst 2021-06-24 10:50:38 +02:00 committed by GitHub
commit 378b39e1ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

2
package-lock.json generated
View File

@ -6760,7 +6760,7 @@
"dev": true "dev": true
}, },
"cdav-library": { "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", "from": "git+https://github.com/nextcloud/cdav-library.git",
"requires": { "requires": {
"core-js": "^3.14.0", "core-js": "^3.14.0",

View File

@ -9,7 +9,7 @@ export default {
name: 'Moment', name: 'Moment',
props: { props: {
timestamp: { timestamp: {
type: Number, type: [Date, Number],
required: true, required: true,
}, },
format: { format: {
@ -19,10 +19,16 @@ export default {
}, },
computed: { computed: {
title() { title() {
return moment.unix(this.timestamp).format(this.format) return moment.unix(this.numericTimestamp).format(this.format)
}, },
formatted() { 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
}, },
}, },
} }