diff options
author | Teddy Wing | 2017-06-03 16:56:42 +0200 |
---|---|---|
committer | Teddy Wing | 2017-06-03 16:56:42 +0200 |
commit | 341e22ef6b8290bba8ba43ecddb9f1175b3cafb9 (patch) | |
tree | 12d843e380b5edb4988b860c909d68ccef1bca7b /timetask/time_entry.go | |
parent | 4a4b8e00ae62ec3898b7e4f590bd4a3660a0f535 (diff) | |
download | timetasker-341e22ef6b8290bba8ba43ecddb9f1175b3cafb9.tar.bz2 |
main.go: Handle the `--date` argument
If no date is passed in, default to the current date. Otherwise, parse
the date into a time that can be used to create the `TimeEntry`.
* Rename `date` to `date_str` to allow us to use `date` for the
`time.Time` that gets sent to `NewTimeEntry()`.
* If parsing fails, print an error message and exit.
* In order to use the `err` variable without redefining `date` on line
66, define it at the top of the function.
Diffstat (limited to 'timetask/time_entry.go')
0 files changed, 0 insertions, 0 deletions