GothenburgBitFactory / GothenburgBitFactory/taskwarrior

Add an "end of period" date modifier

Open
#2,709 2 comments 6 reactions 0 assignees View on GitHub
topic:time
Dominant language
C++
Stars
6.1k
Forks
423
Avg merge
1d 19h
Merged PRs (30d)
11

Description

I find there are a number of cases where one may want to set a `due` date *at the end* of a given period, e.g. to add a task due:

* today, end of day
* tomorrow, end of day
* March, end of month
* 2024, end of year

There are several `eo-` shortcuts covering some of these cases (https://github.com/GothenburgBitFactory/libshared/blob/master/src/Datetime.cpp#L551), but they mostly help setting a date at the end of a given *day*. What I find is missing is a general "end of period" modifier, which completes the unspecified parts of a date with the latest possible value, instead of the earliest one.

Some examples with clarify. Let's assume the "end of period" modifier is `]`. Then:

* `due:today]` means today at 23:59:59
* `due:tomorrow]` means tomorrow at 23:59:59
* `due:march]` means `2022-03-31 23:59:59`
* `due:2024]` means `2024-12-31 23:59-59`

Something similar was already mentioned here: https://github.com/GothenburgBitFactory/taskwarrior/issues/179#issuecomment-365012602, but that was about an "end of day" modifier, not an "end of period".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.