Update blank state for datetime filters [SCI-6571] (#3891)

Co-authored-by: Anton <anton@scinote.net>
This commit is contained in:
aignatov-bio 2022-02-23 14:55:04 +01:00 committed by GitHub
parent c097b321a7
commit f7cc20ebab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 2 deletions

View file

@ -55,6 +55,7 @@
}, },
methods: { methods: {
formattedDate(date) { formattedDate(date) {
if (!date) return null
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
} }
} }

View file

@ -57,6 +57,7 @@
}, },
methods: { methods: {
formattedDate(date) { formattedDate(date) {
if (!date) return null
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}` return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}`
} }
} }

View file

@ -78,6 +78,7 @@
}, },
methods: { methods: {
formattedDate(date) { formattedDate(date) {
if (!date) return null
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}` return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}`
} }
} }

View file

@ -76,6 +76,7 @@
}, },
methods: { methods: {
formattedDate(date) { formattedDate(date) {
if (!date) return null
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
} }
} }

View file

@ -57,6 +57,7 @@
}, },
methods: { methods: {
formattedDate(date) { formattedDate(date) {
if (!date) return null
return `${date.getHours()}:${date.getMinutes()}` return `${date.getHours()}:${date.getMinutes()}`
} }
} }

View file

@ -59,6 +59,7 @@
}, },
methods: { methods: {
formattedDate(date) { formattedDate(date) {
if (!date) return null
return `${date.getHours()}:${date.getMinutes()}` return `${date.getHours()}:${date.getMinutes()}`
} }
} }

View file

@ -53,8 +53,8 @@
}, },
recalcTimestamp() { recalcTimestamp() {
let date = this.timeOnly ? new Date() : this.date; let date = this.timeOnly ? new Date() : this.date;
if (this.isValidDate(date)) { if (this.isValidDate(date) && (this.dateOnly || this.isValidTime())) {
if (!this.isValidTime()) { if (this.dateOnly) {
date.setHours(0); date.setHours(0);
date.setMinutes(0); date.setMinutes(0);
} else { } else {