1
0

fix(tasks): clarify usage of repeating modes available in quick add magic.

Originally, it was possible to specify repeating intervals for months or years. This was actually misleading because the interval would be converted to seconds under the hood, causing all kinds of problems with leap years and months with 30 vs 31 days. Because of that, the options for month and year were removed in 7746d39161 to make it clear what these actually meant.
Now, since we do have a repeating mode "Monthly", this commit changes the behaviour to repeat a task monthly when it was specified as "every month", but only that. All other cases were removed from the docs since they are not actually supported.

https://github.com/go-vikunja/vikunja/issues/271
This commit is contained in:
kolaente
2024-06-18 15:41:30 +02:00
parent eafd134be5
commit 9f604eca79
2 changed files with 7 additions and 4 deletions

View File

@ -88,9 +88,6 @@
<li>Every week</li>
<li>Every 2 weeks</li>
<li>Every month</li>
<li>Every 6 months</li>
<li>Every year</li>
<li>Every 2 years</li>
</ul>
</card>
</modal>

View File

@ -30,6 +30,8 @@ import ProjectUserService from '@/services/projectUsers'
import {useAuthStore} from '@/stores/auth'
import {type TaskFilterParams} from '@/services/taskCollection'
import {getRandomColorHex} from '@/helpers/color/randomColor'
import {REPEAT_TYPES} from '@/types/IRepeatAfter'
import {TASK_REPEAT_MODES} from '@/types/IRepeatMode'
interface MatchedAssignee extends IUser {
match: string,
@ -454,6 +456,10 @@ export const useTaskStore = defineStore('task', () => {
})
task.repeatAfter = parsedTask.repeats
if (parsedTask.repeats?.type === REPEAT_TYPES.Months && parsedTask.repeats?.amount === 1) {
task.repeatMode = TASK_REPEAT_MODES.REPEAT_MODE_MONTH
}
const taskService = new TaskService()
try {
const createdTask = await taskService.create(task)