timetrap icon indicating copy to clipboard operation
timetrap copied to clipboard

at flag should use today's date

Open phantomwhale opened this issue 10 years ago • 2 comments

This evening, I realised I forgot to track a couple of hours in the morning on an ongoing project, so typed

t resume -a 08:15 t out -a 10:15

But this added them as entries for TOMORROW morning ? Any reason why it does this, rather than use today's date ?

phantomwhale avatar Mar 19 '14 10:03 phantomwhale

I believe the current behavior is to choose the time closest to the current time when there's ambiguity (e.g. if it's 9:15pm choose 10:15pm one hour in the future instead of 10:15am 11 hours in the past). For cases where this isn't the desired behavior you'd need to be more explicit (e.g. "today 10:15 am")

See https://github.com/samg/timetrap/blob/master/lib/timetrap/timer.rb#L34-L39 for the spot this is implemented.

Let me know if this isn't the behavior you're observing or if you have suggestions on how to improve it.

samg avatar Apr 06 '14 17:04 samg

I guess I personally expected it to use today's date, by default, no matter what time I entered.

I also thought I entered those times I gave above late in the evening (around midnight), so would have thought they would have gone back 2-4 hours, rather than forward 8-10 hours from what you are suggesting ? But it was a while ago, so I cannot be sure if that's exactly what happened.

I've learned the ways of specifiying date and AM/PM now, so it's less of an issue as I get more comfortable with the tool, but from my perspective (and I understand it's just MY perspective !) the expectation above was the "least surprising" behavior

phantomwhale avatar Apr 07 '14 12:04 phantomwhale