GothenburgBitFactory / GothenburgBitFactory/timewarrior
please support values <1 in durations
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 117
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
Hi,
trying to add a decimal duration < 1 triggers `Unrecognized date range:`.
decimals work fine but only >1.
e.g.
```
~$ timew track 0.5d after 1970-01-02T00:00 test
Unrecognized date range: 'after '.
~$ timew track 1.5d after 1970-01-02T00:00 test
Recorded test
Started 1970-01-02T00:00:00
Ended 03T12:00:00
Total 36:00:00
```
```
~$ timew track 0.5h after 1970-01-02T00:00 test
Unrecognized date range: 'after '.
~$ timew track 1.5h after 1970-01-02T00:00 test
Recorded test
Started 1970-01-02T00:00:00
Ended 01:30:00
Total 0:00:00
```
Of course, I can use 30min instead of 0.5h, but it would be nice to support 0.x notation.
(trying to track time in bulk from a text file containing durations in hours in my case).
Cheers,
Contributor guide
Research direction
Start by reproducing the 0.5d and 0.5h commands shown in the issue, then trace the duration parsing entry point that rejects values below 1. Compare it with the working 1.5d and 1.5h cases; done means decimal durations below 1 are accepted and produce the expected recorded interval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100