Set date when choosing one

This commit is contained in:
kolaente 2020-11-25 18:20:11 +01:00
parent c75549abcb
commit 8d056c6a81
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 1 deletions

View File

@ -159,7 +159,14 @@ export default {
this.show = false
},
setDate(date) {
console.log(date)
if (this.date === null) {
this.date = new Date()
}
const interval = calculateDayInterval(date)
const newDate = new Date()
newDate.setDate(newDate.getDate() + interval)
this.date = newDate
},
getDayIntervalFromString(date) {
return calculateDayInterval(date)