https://github.com/tbabej/task.default-date-time
A hook to change default time for tasks when only date is specified. May your today's task no longer be overdue!
https://github.com/tbabej/task.default-date-time
Last synced: about 1 year ago
JSON representation
A hook to change default time for tasks when only date is specified. May your today's task no longer be overdue!
- Host: GitHub
- URL: https://github.com/tbabej/task.default-date-time
- Owner: tbabej
- License: other
- Created: 2015-01-08T14:22:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-11-17T18:28:10.000Z (over 3 years ago)
- Last Synced: 2025-04-26T23:28:45.566Z (about 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 27
- Watchers: 1
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Taskwarrior Default Date Time Tracking Hook
-------------------------------------------
This is a pair of hooks for TaskWarrior (http://www.taskwarrior.org),
which allow you to set a different time when specifying due time
using only dates.
Install
-------
Note: This hook has been rewritten to leverage taskpirate, for greater hook efficiency.
Please see https://github.com/tbabej/taskpirate for instructions. Don't worry, it's straightforward.
```
git clone https://github.com/tbabej/taskwarrior-default-date-time-hook.git ~/.task/hooks/default-time
```
This hook leverages tasklib, so you need to install that too:
```
pip --user install tasklib
```
Configuration
-------------
Edit the script and set your desired default time (in your local timezone).
For default task date time of 21:30, it should look as follows:
```
DEFAULT_TIME = time(21,30,0) # Your wanted default time
```
Example of usage
----------------
Add a task that has specified due time, but only as a date.
```
$ task add test due:today
Created task 4.
Default due time has been set.
```
We can see the message is outputted to notify us that
custom default due time has been used. Indeed, if we check:
```
$ task 4 info
Name Value
ID 4
Description test
Status Pending
Entered 2015-01-08 07:17:26 (44 seconds)
Due 2015-01-08 22:00:00
Last modified 2015-01-08 07:17:26 (44 seconds)
UUID 86d1b114-6550-4213-82dd-d42a05828288
Urgency 8.672
due 0.723 * 12 = 8.67
```
We can see this task has due time of 22:00.