tracktime

Small utility for tracking working hours in a plain text file

git clone https://git.8pit.net/tracktime.git

 1# tracktime
 2
 3Small utility for tracking working hours in a plain text file.
 4
 5## Usage
 6
 7Tracking working hours is complicated as one usually has to consider
 8holidays and vacations for determining required working hours. This tool
 9takes a different approach by assuming that one has to work the same
10amount of hours on each tracked day. Based on this assumption, the tool
11calculates a delta between all tracked workdays to determine the current
12overtime.
13
14For instance, if one has to work 8 hours each day and worked 9 hours on
15the 6th of January only 7 hours of work would be required on the 7th of
16January:
17
18	$ cat ~/.tracktime
19	06.01.2020	0900	1800	Important work stuff
20	07.01.2020	1000	1700	More important work stuff
21	$ tracktime -h 8 ~/.tracktime
22	06.01.2020      9h0m0s  | 1h0m0s
23	07.01.2020      7h0m0s  | 0s
24
25The last column of the `tracktime` output represents the described
26delta. In this example, it is zero on the 7th of January even though
27only 7 hours of work were done. The overtime done on the 6th of January
28is used to compensate for the shortage.
29
30## Input format
31
32The input format uses four tab-separated fields. The fields have the
33following meaning:
34
351. Workday. Multiple entries for the same day are allowed. The
36   utilized date format can be customized using the `TRACKTIME_FORMAT`
37   environment variable. Refer to the documentation of the
38   [Go time pkg](https://golang.org/pkg/time/#pkg-constants) for more
39   information.
402. Starting time of the described activity without a hours/minutes
41   separator and padded with zeros to four digits.
423. End time of the described activity.
434. Description of the activity.
44
45A parser for the input format is available in the `parser/`
46subdirectory. The parser can be imported as a Go library to write custom
47tooling, e.g. format conversion tools for importing data into existing
48time tracking systems.
49
50## Installation
51
52No dependencies, simply use `go get`:
53
54	$ go get github.com/nmeum/tracktime
55
56Additional utilities are available in the `contrib/` directory and can
57be installed separately, also through `go get`.
58
59## License
60
61This program is free software: you can redistribute it and/or modify it
62under the terms of the GNU General Public License as published by the
63Free Software Foundation, either version 3 of the License, or (at your
64option) any later version.
65
66This program is distributed in the hope that it will be useful, but
67WITHOUT ANY WARRANTY; without even the implied warranty of
68MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
69Public License for more details.
70
71You should have received a copy of the GNU General Public License along
72with this program. If not, see <http://www.gnu.org/licenses/>.