GothenburgBitFactory / GothenburgBitFactory/timewarrior

on-modify.timewarrior: The start command does not accept ranges but only a single datetime.

Open
#451 14 comments 2 reactions 0 assignees View on GitHub
on-modify-hook
Dominant language
C++
Stars
1.7k
Forks
117
Avg merge
1d 7h
Merged PRs (30d)
5

Description

It seems like the hook script doesn't like it, when a given tag can be read as time/date:

The script works fine without a tag:
```
tasksh> add 'Test Timewarrior'
[task add 'Test Timewarrior']
Created task 302.
tasksh> start 302
[task start 302]
Starting task a36684d6 'Test Timewarrior'.
Started 1 task.
Tracking "Test Timewarrior"
Started 2021-09-24T08:12:10
Current 10
Total 0:00:00
You have more urgent tasks.
tasksh> stop 302
[task stop 302]
Stopping task a36684d6 'Test Timewarrior'.
Stopped 1 task.
Recorded "Test Timewarrior"
Started 2021-09-24T08:12:10
Ended 12
Total 0:00:02
```

Script fails with the tag `today`:
```
tasksh> 302 mod +today
[task 302 mod +today]
Modifying task 302 'Test Timewarrior'.
Modified 1 task.
tasksh> start 302
[task start 302]
The start command does not accept ranges but only a single datetime. Perhaps you want the track command?
Starting task a36684d6 'Test Timewarrior'.
Started 1 task.

tasksh> stop 302
[task stop 302]
There is no active time tracking.
Stopping task a36684d6 'Test Timewarrior'.
Stopped 1 task.
```

Tag `anything` works fine again:
```
tasksh> 302 mod -today +anything
[task 302 mod -today +anything]
Modifying task 302 'Test Timewarrior'.
Modified 1 task.
tasksh> start 302
[task start 302]
Starting task a36684d6 'Test Timewarrior'.
Started 1 task.
Note: 'anything' is a new tag.
Tracking "Test Timewarrior" anything
Started 2021-09-24T08:14:21
Current 21
Total 0:00:00
You have more urgent tasks.
tasksh> stop 302
[task stop 302]
Stopping task a36684d6 'Test Timewarrior'.
Stopped 1 task.
Recorded "Test Timewarrior" anything
Started 2021-09-24T08:14:21
Ended 23
Total 0:00:02
```

Anything I can do to fix of help to solve the problem?

Thanks for your work!

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.