fnogatz / clocker

Command-line tool to track project hours
Other
420 stars 31 forks source link

silent NaN entries on badly formatted date #32

Closed hackergrrl closed 6 years ago

hackergrrl commented 8 years ago
$ clocker add "2016-01-25-8:45" "2016-01-25-10:20"

$ clocker list
NaN  NaN-NaN-NaN  [ NaN:NaN:NaN - NaN:NaN:NaN ]  (NaN:NaN:NaN)

These are impossible to get rid of using clocker rm -- their STAMP can't be referenced to.

clocker should error out on badly formatted dates.

fnogatz commented 8 years ago

I added a patch and published it as v1.11.3. Nevertheless this does not solve the issue at all, as substack/parse-messy-time still accepts an invalid date like "2016-01-23-12:34:45"and interprets it as "the day of 2016 hours in future". Further investigation in substack/parse-messy-time#5.

coreyjewett commented 6 years ago

I encountered this almost immediately playing with with clocker. I introduced NaN by trying to specify a STAMP as the start time:

$> clocker set 1512201600 start 1512235800
$> clocker list
NaN  NaN-NaN-NaN  [ NaN:NaN:NaN - NOW ]  (NaN:NaN:NaN)

If you notice the problem immediately then you can repair the record using set because it will modify the last record:

$> clocker set start 09:30

This only addresses a sub-usecase of @noffle's problem.

fnogatz commented 6 years ago

@coreyjewett I have added support for timestamps in v1.11.4.

fnogatz commented 6 years ago

To directly address already set NaN entries, we will continue in #34.