fix(quick add magic): annually and variants spelling

Related to vikunja/frontend#3676
This commit is contained in:
kolaente 2023-07-13 18:05:19 +02:00
parent 33fe5e4f20
commit 25b110ce48
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 5 additions and 5 deletions

View File

@ -719,8 +719,8 @@ describe('Parse Task Text', () => {
'every year': {type: 'years', amount: 1},
'every 1 year': {type: 'years', amount: 1},
'every 4 years': {type: 'years', amount: 4},
'anually': {type: 'years', amount: 1},
'bianually': {type: 'months', amount: 6},
'annually': {type: 'years', amount: 1},
'biannually': {type: 'months', amount: 6},
'semiannually': {type: 'months', amount: 6},
'biennially': {type: 'years', amount: 2},
'daily': {type: 'days', amount: 1},

View File

@ -165,7 +165,7 @@ const getPriority = (text: string, prefix: string): number | null => {
}
const getRepeats = (text: string): repeatParsedResult => {
const regex = /((every|each) (([0-9]+|one|two|three|four|five|six|seven|eight|nine|ten) )?(hours?|days?|weeks?|months?|years?))|anually|bianually|semiannually|biennially|daily|hourly|monthly|weekly|yearly/ig
const regex = /((every|each) (([0-9]+|one|two|three|four|five|six|seven|eight|nine|ten) )?(hours?|days?|weeks?|months?|years?))|annually|biannually|semiannually|biennially|daily|hourly|monthly|weekly|yearly/ig
const results = regex.exec(text)
if (results === null) {
return {
@ -216,13 +216,13 @@ const getRepeats = (text: string): repeatParsedResult => {
type = REPEAT_TYPES.Years
amount = 2
break
case 'bianually':
case 'biannually':
case 'semiannually':
type = REPEAT_TYPES.Months
amount = 6
break
case 'yearly':
case 'anually':
case 'annually':
type = REPEAT_TYPES.Years
break
case 'daily':