Skip Menu |

This queue is for tickets about the App-TimeTracker CPAN distribution.

Report information
The Basics
Id: 73859
Status: resolved
Priority: 0/
Queue: App-TimeTracker

People
Owner: domm [...] cpan.org
Requestors: ruz [...] bestpractical.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.015
Fixed in: (no value)



Subject: wrong day picked for `tracker stop --at 2:40`
Date: Tue, 10 Jan 2012 03:23:29 +0400
To: bug-App-TimeTracker [...] rt.cpan.org
From: Ruslan Zakirov <ruz [...] bestpractical.com>
Hi, It's 3 after midnight and I just ran `tracker stop --at 2:40` and result is quite unexpected: tracker list ... | Duration | Start | Stop ... ... | 23:22:25 | 02:02:25 | yesterday 02:40:00 -- Best regards, Ruslan.
On Mon Jan 09 18:23:37 2012, ruz@bestpractical.com wrote: Show quoted text
> Hi, > > It's 3 after midnight and I just ran `tracker stop --at 2:40`
Don't you know it's against union rules to work so late! No wonder the poor software gets confused... :-) Show quoted text
> and > result is quite unexpected:
ok, seriously, it seems that 'stop' doesn't realise the day change. I'll take a look, shouldn't be that hard to fix... Thanks for the feedback! domm
I tried to reproduce this bug (but without actually changing my system clock to fake a day-change) and failed, i.e. it seems to work on my machine / version. What version of App::TimeTracker are you using? You can use perl -E 'use App::TimeTracker 999' to figure out the current version (until I implement a 'version' command..) Would you mind sending me the broken .trc file? (You can find it by using tracker list --detail ) thanks!
Subject: Re: [rt.cpan.org #73859] wrong day picked for `tracker stop --at 2:40`
Date: Tue, 10 Jan 2012 14:10:39 +0400
To: bug-App-TimeTracker [...] rt.cpan.org
From: Ruslan Zakirov <ruz [...] bestpractical.com>
On Tue, Jan 10, 2012 at 11:57, Thomas Klausner via RT <bug-App-TimeTracker@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=73859 > > > > I tried to reproduce this bug (but without actually changing my system > clock to fake a day-change) and failed, i.e. it seems to work on my > machine / version.
Use http://search.cpan.org/~ddick/Test-MockTime-0.12/lib/Test/MockTime.pod Show quoted text
> What version of App::TimeTracker are you using? > You can use >  perl -E 'use App::TimeTracker 999' > to figure out the current version (until I implement a 'version' command..)
Latest available from cpan - 2.014 Show quoted text
> Would you mind sending me the broken .trc file? > (You can find it by using >  tracker list --detail > )
Found it already and hand-edited. Everything was consistent. Start date later than end date. Time in seconds was negative. Show quoted text
> thanks!
-- Best regards, Ruslan.
A fixed version (2.016) is on it's way to CPAN at the moment (and already on github). While I could not reproduce your exact problem, I think I discovered what happend: I assume you issued the --stop command a very short time before midnight, thus '2:30' was interpreted as 2:30 that morning, not the following day. 'stop' now aborts if the stop time is earlier than the start time, which should have prevented your troubles (if my assumption is true..) The only other explanation would be some time-zone issues... Anyway, thanks for the feedback (and the Test::MockTime tip), greetings, domm
Subject: Re: [rt.cpan.org #73859] wrong day picked for `tracker stop --at 2:40`
Date: Wed, 11 Jan 2012 03:31:13 +0400
To: bug-App-TimeTracker [...] rt.cpan.org
From: Ruslan Zakirov <ruz [...] bestpractical.com>
On Wed, Jan 11, 2012 at 02:17, Thomas Klausner via RT <bug-App-TimeTracker@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=73859 > > > A fixed version (2.016) is on it's way to CPAN at the moment (and > already on github). > > While I could not reproduce your exact problem, I think I discovered > what happend: I assume you issued the --stop command a very short time > before midnight, thus '2:30' was interpreted as 2:30 that morning, not > the following day.
Nope. It was not the case. As I said in the first mail it was 03:XX. Just wanted to subtract 30minutes as I forgot to stop timer. Show quoted text
> 'stop' now aborts if the stop time is earlier than the start time, which > should have prevented your troubles (if my assumption is true..)
Would love to see app to be interactive in this case. Just add days until end time is later than start time and ask if user ment this time instead. What do you think about this? For example: tracker stop --at HH:MM Hey, you started at ..., but asked to stop at ... Did you mean ...? [Y/n] Show quoted text
> The only other explanation would be some time-zone issues...
Europe/Moscow Show quoted text
> Anyway, thanks for the feedback (and the Test::MockTime tip), > greetings, > domm
-- Best regards, Ruslan.
Subject: Re: [rt.cpan.org #73859] wrong day picked for `tracker stop --at 2:40`
Date: Wed, 11 Jan 2012 08:30:20 +0100
To: Ruslan Zakirov via RT <bug-App-TimeTracker [...] rt.cpan.org>
From: Thomas Klausner <domm [...] plix.at>
Hi! On Tue, Jan 10, 2012 at 06:31:22PM -0500, Ruslan Zakirov via RT wrote: Show quoted text
> Nope. It was not the case. As I said in the first mail it was 03:XX. > Just wanted to subtract 30minutes as I forgot to stop timer.
oh, sorry, I misread that for 0:03 (i.e 3 minutes after midnight) Show quoted text
> > 'stop' now aborts if the stop time is earlier than the start time, which > > should have prevented your troubles (if my assumption is true..)
> > Would love to see app to be interactive in this case. Just add days > until end time is later than start time and ask if user ment this time > instead. What do you think about this? For example:
Yeah, that sounds nice. Show quoted text
> > The only other explanation would be some time-zone issues...
> > Europe/Moscow
Hm, as Moscow is GMT+3/4 I'm now quite sure what the real problem is: You issued stop at 3:50, but DateTime converts that to 23:50. I'll take another look at this issue later today. Greetings, domm -- #!/usr/bin/perl http://domm.plix.at for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
On Tue Jan 10 18:31:22 2012, ruz@bestpractical.com wrote: Show quoted text
> Nope. It was not the case. As I said in the first mail it was 03:XX. > Just wanted to subtract 30minutes as I forgot to stop timer.
Ha, I now finally found the bug. During coercion of --at into a DateTime object, new such object were created, but without setting time_zone to 'local'. So they used UTC, which is the reason why you got off times. It's fixed now on github & on it's way to CPAN. Thanks, domm