1
0

fix: make sure weekday parsing in quick add magic ignores the casing

Resolves https://kolaente.dev/vikunja/frontend/issues/2105
This commit is contained in:
kolaente
2022-07-11 12:35:08 +02:00
parent 990639dd24
commit dff5d84ebb
2 changed files with 54 additions and 9 deletions

View File

@ -222,8 +222,8 @@ export const getDateFromTextIn = (text: string, now: Date = new Date()) => {
}
const getDateFromWeekday = (text: string): dateFoundResult => {
const matcher: RegExp = / (next )?(monday|mon|tuesday|tue|wednesday|wed|thursday|thu|friday|fri|saturday|sat|sunday|sun)($| )/ig
const results: string[] | null = matcher.exec(text)
const matcher: RegExp = / (next )?(monday|mon|tuesday|tue|wednesday|wed|thursday|thu|friday|fri|saturday|sat|sunday|sun)($| )/g
const results: string[] | null = matcher.exec(text.toLowerCase()) // The i modifier does not seem to work.
if (results === null) {
return {
foundText: null,