fix: unit test for "should recognize dates of the month in the past but next month" (#1131)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1131 Reviewed-by: konrad <k@knt.li> Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:

committed by
konrad

parent
e535584412
commit
20f0496fa5
@ -297,7 +297,8 @@ const getDayFromText = (text: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
const date = new Date()
|
||||
const now = new Date()
|
||||
const date = new Date(now)
|
||||
const day = parseInt(results[0])
|
||||
date.setDate(day)
|
||||
|
||||
@ -309,7 +310,7 @@ const getDayFromText = (text: string) => {
|
||||
date.setDate(day)
|
||||
}
|
||||
|
||||
if (date < new Date()) {
|
||||
if (date < now) {
|
||||
date.setMonth(date.getMonth() + 1)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user