replace momentjs (incl. calendar)

This commit is contained in:
Thomas Ruoff
2020-09-22 00:21:08 +02:00
committed by Thomas Ruoff
parent 7f4604f0e6
commit 02c2b45747
6 changed files with 161 additions and 115 deletions

View File

@@ -65,7 +65,10 @@ const BookingSchema = new mongoose.Schema<BookingDocument>(
)
BookingSchema.virtual('days').get(function () {
return getDays({ startDate: this.startDate, endDate: this.endDate })
return getDays({
startDate: new Date(this.startDate),
endDate: new Date(this.endDate),
})
})
BookingSchema.static('findBookedDays', async function (): Promise<string[]> {