feat: recurring for quick add magic #1105
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#1105
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/recurring-nlp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds support for recurring tasks to quick add magic.
This means you can do something like "Bring out the trash every week" and it will create a task that repeats every week.
It supports all types of repeating amounts you can set on the task detail page.
Relevant forum discussion: https://community.vikunja.io/t/natural-language-for-recurring-tasks/478
Hi konrad!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://1105-featurerecurring-nlp--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
There can be a lot of cases added.
Other then that really nice! =)
@ -135,0 +169,4 @@
const amount = results[3] ? parseInt(results[3]) : 1
let type: RepeatType = RepeatType.Hours
switch (results[4]) {
Missing a lot of cases.
Some inspiration: https://en.wiktionary.org/wiki/Category:English_frequency_adverbs
I guess this is the stuff where Todoist really performes well =)
Wow that's a long list! I think including some of them makes sense, some others are a topic for another day. The quick wins like yearly, weekly, monthly etc should be included.
Added a few more cases. I think this is fine for now.
@ -133,2 +157,4 @@
}
const getRepeats = (text: string): repeatParsedResult => {
const regex = /((every|each) ([0-9]+ )?(hours?|days?|weeks?|months?|years?))|anually|bianually|semiannually|biennially|daily|hourly|monthly|weekly|yearly/ig
I think we should also add written numbers. E.g. 'every two days'
Hmm yes. The question is, how much should we include? I don't think we can add all numbers as words. Maybe only up to 10?
You probably will use the other variants anyway, eg instead of saying "28 days" you'd say "4 weeks".
Yes I meant all the words that are not composed. Especially the ones under 10.
At least in German it is usual to write numbers under ten sometimes twenty (😆 ) in letters (as you know), but I guess it's the same for English aswell. So I guess:
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
Eleven
Twelve
Thirteen
Fourteen
Fifteen
Sixteen
Seventeen
Eighteen
Nineteen
Added for all numbers up until 10, I think that should be enough.