App::TimeTracker 2.016
posted by domm on 10.01.2012 at 23:31:12 ·
This versions prevents some annoying behavior, as discovered by Ruslan Zakirov in this bug
If you start
a task on 2012-01-10 late in the evening, and (even later, but before midnight) do stop --at 01:00
, App::TimeTracker would assume you meant 1:00 on the 10th, and not on the 11th, resulting in negative time spend on the task.
To prevent the universe from collapsing, App::TimeTracker now aborts stop
if the specified stop time is earlier than the starting time of the current task.
Ruslan pointed me to Test::MockTime, which allows you to mock the current time to arbitrary values; very handy for testing stuff like this... See the gory details here on github
One note on using Test::MockTime together with DateTime: As noted by time-overlord Zefram here, you have to load Test::MockTime before loading DateTime (or anything else that might use DateTime) - or it won't be able to do it's magic. Hm, I guess I should submit a doc-patch...
So what do you think?