fix(tasks): clarify usage of repeating modes available in quick add magic.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
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 7746d3916157e43fca7a24e2a768f7fb83136cf1 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:
parent
eafd134be5
commit
9f604eca79
@ -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>
|
||||
|
@ -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,
|
||||
@ -453,7 +455,11 @@ export const useTaskStore = defineStore('task', () => {
|
||||
position,
|
||||
})
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user