Skip to content

Richer relative times

Dirk HOFFMANN requested to merge github/fork/ederag/richer-relative-times into master

Created by: ederag

This started as a fix to the following behavior: to enter -10 activity, while typing, -10 was interpreted as an activity, until the a was typed, and only then -10 was interpreted as a start. Now -10 is interpreted as a start right after 1 is typed. Note: There is no way to know what the user has in mind until the second character is typed, so at first - appears in the activity, which is fine actually (tried to swallow it, worse down the line)

Then, since parser was touched, it became irresistible to add the possibility for positive relative times, entered as +nnn (plus sign followed by 1 to 3 digits). Signed relative times (e.g. -10or +10) are always relative to reference (normally, now).

Finally my preferred one; end time can be replaced with the fact duration (1 to 3 digits without any sign): -50 20 means start 50 min ago, duration 20 minutes (hence end 30 minutes ago).

Note: double dash -- can be used instead of a relative time, mean an explicit None, so any kind of activity can be entered now (even beginning time-like), provided both start and end are explicit.

Merge request reports

Loading