fix(quick add magic): annually and variants spelling
Related to https://kolaente.dev/vikunja/frontend/issues/3676
This commit is contained in:
parent
33fe5e4f20
commit
25b110ce48
@ -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},
|
||||
|
@ -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':
|
||||
|
Loading…
x
Reference in New Issue
Block a user