Feature request: take into account different lengths of months and years for repeating tasks #698

Closed
opened 2020-10-23 11:15:17 +00:00 by andreymal · 4 comments
Contributor

As I see on try.vikunja.io, the repeating tasks API only uses seconds to calculate next date. But IRL there are some tasks that are tied to a fixed day of month/year, and it would be good if Vikunja could take this into account.

(Not sure how to properly handle 31 Feb... But it seems Google Calendar just skips nonexistent days.) (In general, repeating tasks in Google Calendar is a good role model: they are so powerful.)

For example, I need to pay for the Internet by the 25th of each month:

Current behavior Desired behavior
25 Oct 2020 25 Oct 2020
24 Nov 2020 25 Nov 2020
24 Dec 2020 25 Dec 2020
23 Jan 2021 25 Jan 2021
22 Feb 2021 25 Feb 2021
24 Mar 2021 25 Mar 2021
23 Apr 2021 25 Apr 2021

As another example, I need to pay for cloud storage before January 12 of each year:

Current behavior Desired behavior
12 Jan 2021 12 Jan 2021
12 Jan 2022 12 Jan 2022
12 Jan 2023 12 Jan 2023
12 Jan 2024 12 Jan 2024
11 Jan 2025 12 Jan 2025
11 Jan 2026 12 Jan 2026
As I see on try.vikunja.io, the repeating tasks API only uses seconds to calculate next date. But IRL there are some tasks that are tied to a fixed day of month/year, and it would be good if Vikunja could take this into account. (Not sure how to properly handle 31 Feb... But it seems Google Calendar just skips nonexistent days.) (In general, repeating tasks in Google Calendar is a good role model: they are so powerful.) For example, I need to pay for the Internet by the 25th of each month: | Current behavior | Desired behavior | |------------------|------------------| | 25 Oct 2020 | 25 Oct 2020 | | 24 Nov 2020 | 25 Nov 2020 | | 24 Dec 2020 | 25 Dec 2020 | | 23 Jan 2021 | 25 Jan 2021 | | 22 Feb 2021 | 25 Feb 2021 | | 24 Mar 2021 | 25 Mar 2021 | | 23 Apr 2021 | 25 Apr 2021 | As another example, I need to pay for cloud storage before January 12 of each year: | Current behavior | Desired behavior | |------------------|------------------| | 12 Jan 2021 | 12 Jan 2021 | | 12 Jan 2022 | 12 Jan 2022 | | 12 Jan 2023 | 12 Jan 2023 | | 12 Jan 2024 | 12 Jan 2024 | | 11 Jan 2025 | 12 Jan 2025 | | 11 Jan 2026 | 12 Jan 2026 |
Owner

Thanks for the suggestion!

I think it makes sense to add this to Vikunja. I've added it to the public backlog.

Thanks for the suggestion! I think it makes sense to add this to Vikunja. I've added it to the public backlog.
konrad added the
kind/feature
label 2020-10-24 12:26:50 +00:00
Owner

Implemented in vikunja/api#834 - A new unstable release should be ready soon.

Implemented in https://kolaente.dev/vikunja/api/pulls/834 - A new unstable release should be ready soon.
Author
Contributor

"Monthly" works great, thank you!

But it seems repeat mode doesn't take into account leap years: when I set "Repeat Mode - From Current Date; Each 3 Years", the new due date is set to "Apr 14, 2024" instead of Apr 15, 2024 (however I'm not really sure if this should be considered a bug or a feature)

"Monthly" works great, thank you! But it seems repeat mode doesn't take into account leap years: when I set "Repeat Mode - From Current Date; Each 3 Years", the new due date is set to "Apr 14, 2024" instead of Apr 15, 2024 (however I'm not really sure if this should be considered a bug or a feature)
Owner

That could be a bug, would be one to fix in the Go standard library. I'm just telling it "Add this duration (three years in your example) to the current date and set the result as the new date)".

EDIT On second thought this actually looks like a bug in Vikunja - A year for Vikunja is 365 days. And leap years have 366...

I would consider this an edge case though with a non-trivial fix. I'll add it to the backlog but with low priority. If you want to send a PR, go for it 🙂

That could be a bug, would be one to fix in the Go standard library. I'm just telling it "Add this duration (three years in your example) to the current date and set the result as the new date)". **EDIT** On second thought this actually looks like a bug in Vikunja - A year for Vikunja is 365 days. And leap years have 366... I would consider this an edge case though with a non-trivial fix. I'll add it to the backlog but with low priority. If you want to send a PR, go for it 🙂
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#698
No description provided.