Skip Menu |

This queue is for tickets about the DateTime-Fiscal-Year CPAN distribution.

Report information
The Basics
Id: 32301
Status: open
Priority: 0/
Queue: DateTime-Fiscal-Year

People
Owner: Nobody in particular
Requestors: JHANNAH [...] cpan.org
Cc:
AdminCc:

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



Subject: Work week shifts incorrectly when 2008 starts
Date: Mon, 14 Jan 2008 11:51:48 -0600
To: bug-DateTime-Fiscal-Year [...] rt.cpan.org
From: Jay Hannah <jay [...] jays.net>
Hi Jesse -- I think I've stumbled into a bug that has thrown all my software off for 2008. Here's one example. I wanted my work weeks to start on Mondays, so I set up my fiscal back in 2006. my $dt = DateTime->new(year=>2006, month=>12, day=>25); my $fiscal = DateTime::Fiscal::Year->new( start => $dt ); All 2007 this worked great, but once 2008 rolled around, DateTime::Fiscal::Year is incorrectly moving ALL my Mondays to the previous work week. Thanks for your help, j http://jays.net DateTime::Fiscal::Year v0.02 perl 5.8.8 Red Hat 4.1.1-51 $ cat j.pl use Test::More tests => 4; use strict; use DateTime::Fiscal::Year; # My weeks start on Mondays my $dt = DateTime->new(year=>2006, month=>12, day=>25); my $fiscal = DateTime::Fiscal::Year->new( start => $dt ); my $dt2 = DateTime->new(year=>2007, month=>1, day=>7); is($fiscal->week_of_fiscal_year( $dt2 ), 2, "First Sunday 2007"); my $dt2 = DateTime->new(year=>2007, month=>1, day=>8); is($fiscal->week_of_fiscal_year( $dt2 ), 3, "Second Monday 2007"); my $dt2 = DateTime->new(year=>2008, month=>1, day=>6); is($fiscal->week_of_fiscal_year( $dt2 ), 2, "First Sunday 2008"); my $dt2 = DateTime->new(year=>2008, month=>1, day=>7); is($fiscal->week_of_fiscal_year( $dt2 ), 3, "First Monday 2008"); $ perl j.pl 1..4 ok 1 - First Sunday 2007 ok 2 - Second Monday 2007 ok 3 - First Sunday 2008 not ok 4 - First Monday 2008 # Failed test 'First Monday 2008' # in j.pl at line 20. # got: '2' # expected: '3' # Looks like you failed 1 test of 4.
Subject: Re: [rt.cpan.org #32301] Work week shifts incorrectly when 2008 starts
Date: Mon, 14 Jan 2008 12:29:12 -0600
To: bug-DateTime-Fiscal-Year [...] rt.cpan.org
From: "Jesse Shy" <jesseshy [...] gmail.com>
First, let me just say that I had no idea anyone else was using my module, I was stoked to get your bug report. I know this doesn't help with the problem though. I am headed to lunch, I will take a look at it as soon as I get back. Thanks for the report. On Jan 14, 2008 11:52 AM, Jay Hannah via RT < bug-DateTime-Fiscal-Year@rt.cpan.org> wrote: Show quoted text
> > Mon Jan 14 12:52:13 2008: Request 32301 was acted upon. > Transaction: Ticket created by jay@jays.net > Queue: DateTime-Fiscal-Year > Subject: Work week shifts incorrectly when 2008 starts > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: jay@jays.net > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=32301 > > > > Hi Jesse -- > > I think I've stumbled into a bug that has thrown all my software off > for 2008. Here's one example. I wanted my work weeks to start on > Mondays, so I set up my fiscal back in 2006. > > my $dt = DateTime->new(year=>2006, month=>12, day=>25); > my $fiscal = DateTime::Fiscal::Year->new( start => $dt ); > > All 2007 this worked great, but once 2008 rolled around, > DateTime::Fiscal::Year is incorrectly moving ALL my Mondays to the > previous work week. > > Thanks for your help, > > j > http://jays.net > > > DateTime::Fiscal::Year v0.02 > perl 5.8.8 > Red Hat 4.1.1-51 > > > $ cat j.pl > use Test::More tests => 4; > > use strict; > use DateTime::Fiscal::Year; > > # My weeks start on Mondays > my $dt = DateTime->new(year=>2006, month=>12, day=>25); > my $fiscal = DateTime::Fiscal::Year->new( start => $dt ); > > my $dt2 = DateTime->new(year=>2007, month=>1, day=>7); > is($fiscal->week_of_fiscal_year( $dt2 ), 2, "First Sunday 2007"); > > my $dt2 = DateTime->new(year=>2007, month=>1, day=>8); > is($fiscal->week_of_fiscal_year( $dt2 ), 3, "Second Monday 2007"); > > my $dt2 = DateTime->new(year=>2008, month=>1, day=>6); > is($fiscal->week_of_fiscal_year( $dt2 ), 2, "First Sunday 2008"); > > my $dt2 = DateTime->new(year=>2008, month=>1, day=>7); > is($fiscal->week_of_fiscal_year( $dt2 ), 3, "First Monday 2008"); > > > $ perl j.pl > 1..4 > ok 1 - First Sunday 2007 > ok 2 - Second Monday 2007 > ok 3 - First Sunday 2008 > not ok 4 - First Monday 2008 > # Failed test 'First Monday 2008' > # in j.pl at line 20. > # got: '2' > # expected: '3' > # Looks like you failed 1 test of 4. > > > > >
Subject: Re: [rt.cpan.org #32301] Work week shifts incorrectly when 2008 starts
Date: Mon, 14 Jan 2008 12:36:16 -0600
To: bug-DateTime-Fiscal-Year [...] rt.cpan.org
From: Jay Hannah <jay [...] jays.net>
On Jan 14, 2008, at 12:29 PM, Jesse Shy via RT wrote: Show quoted text
> I am headed to lunch, I will take a look at it as soon as I get > back. Thanks > for the report.
Wow! Thanks for the quick reply! In case you're curious, I'm using your module inside my load.pl program, which I just added super-cheesy work-around hacks to this morning: http://jays.net/hours/how_i_track_my_hours.html http://vc.jays.net/viewvc.cgi/www/hours/load.pl?root=jays.net&view=log Cheers, j
Subject: Re: [rt.cpan.org #32301] Work week shifts incorrectly when 2008 starts
Date: Tue, 15 Jan 2008 10:15:43 -0600
To: bug-DateTime-Fiscal-Year [...] rt.cpan.org
From: "Jesse Shy" <jesseshy [...] gmail.com>
So after thinking about this last night, I realized the module works exactly like it is suppose to. You see, you said your fiscal year begins on Dec, 25th. So Dec 25 is the start of each fiscal year. In this case, Dec 25th, 2007 is a Tuesday. So the fiscal year 2008 begins on a Tuesday, making Mondays now the last day of the fiscal week. If you have to leave the start Dec 25th, 2006, I am not sure how to make things function for you, without breaking the modules intent. Any ideas? On Jan 14, 2008 12:36 PM, Jay Hannah via RT < bug-DateTime-Fiscal-Year@rt.cpan.org> wrote: Show quoted text
> > Queue: DateTime-Fiscal-Year > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=32301 > > > On Jan 14, 2008, at 12:29 PM, Jesse Shy via RT wrote:
> > I am headed to lunch, I will take a look at it as soon as I get > > back. Thanks > > for the report.
> > Wow! Thanks for the quick reply! > > In case you're curious, I'm using your module inside my load.pl > program, which I just added super-cheesy work-around hacks to this > morning: > > http://jays.net/hours/how_i_track_my_hours.html > > http://vc.jays.net/viewvc.cgi/www/hours/load.pl?root=jays.net&view=log > > Cheers, > > j > > >
Subject: Re: [rt.cpan.org #32301] Work week shifts incorrectly when 2008 starts
Date: Tue, 15 Jan 2008 10:56:50 -0600
To: bug-DateTime-Fiscal-Year [...] rt.cpan.org
From: Jay Hannah <jay [...] jays.net>
On Jan 15, 2008, at 10:16 AM, Jesse Shy via RT wrote: Show quoted text
> So after thinking about this last night, I realized the module > works exactly > like it is suppose to. You see, you said your fiscal year begins on > Dec, > 25th. So Dec 25 is the start of each fiscal year. In this case, Dec > 25th, > 2007 is a Tuesday. So the fiscal year 2008 begins on a Tuesday, making > Mondays now the last day of the fiscal week.
-ponder- So the idea is that a company declares "our fiscal year starts on July 1"? So July 1-7 is always week 1? So what days are in the fiscal week changes every year? One year the fiscal week is Monday-Sunday, the next year its Tueday-Monday, or whatever? Or does a company declare "our fiscal year starts on the first Monday in July"? In which case I'd need to use your software plus other software to tell me the date is the first Monday of July of any given year? I've never worked for a company that uses a fiscal year, and I'm no accountant, so I'm easily confused. :) Show quoted text
> If you have to leave the start Dec 25th, 2006, I am not sure how to > make > things function for you, without breaking the modules intent. Any > ideas?
Don't worry about me. I'll probably just change my algorithm to some Date::Calc Delta_Days() % 7 kind of operation...? Thanks for your help! You can close this ticket whenever, since my bug report isn't. :) j
Subject: Re: [rt.cpan.org #32301] Work week shifts incorrectly when 2008 starts
Date: Tue, 15 Jan 2008 11:51:37 -0600
To: bug-DateTime-Fiscal-Year [...] rt.cpan.org
From: "Jesse Shy" <jesseshy [...] gmail.com>
That is correct, companies declare a date as the beginning of the fiscal year. The way you have it, Dec 24th of 2007 would be the first day of fy 2008 and fy 2007 would only be 364 days long. Does this clarify? On Jan 15, 2008 10:57 AM, Jay Hannah via RT < bug-DateTime-Fiscal-Year@rt.cpan.org> wrote: Show quoted text
> > Queue: DateTime-Fiscal-Year > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=32301 > > > On Jan 15, 2008, at 10:16 AM, Jesse Shy via RT wrote:
> > So after thinking about this last night, I realized the module > > works exactly > > like it is suppose to. You see, you said your fiscal year begins on > > Dec, > > 25th. So Dec 25 is the start of each fiscal year. In this case, Dec > > 25th, > > 2007 is a Tuesday. So the fiscal year 2008 begins on a Tuesday, making > > Mondays now the last day of the fiscal week.
> > -ponder- So the idea is that a company declares "our fiscal year > starts on July 1"? So July 1-7 is always week 1? So what days are in > the fiscal week changes every year? One year the fiscal week is > Monday-Sunday, the next year its Tueday-Monday, or whatever? > > Or does a company declare "our fiscal year starts on the first Monday > in July"? In which case I'd need to use your software plus other > software to tell me the date is the first Monday of July of any given > year? > > I've never worked for a company that uses a fiscal year, and I'm no > accountant, so I'm easily confused. :) >
> > If you have to leave the start Dec 25th, 2006, I am not sure how to > > make > > things function for you, without breaking the modules intent. Any > > ideas?
> > Don't worry about me. I'll probably just change my algorithm to some > Date::Calc Delta_Days() % 7 kind of operation...? > > Thanks for your help! You can close this ticket whenever, since my > bug report isn't. :) > > j > > >
Subject: Re: [rt.cpan.org #32301] Work week shifts incorrectly when 2008 starts
Date: Tue, 15 Jan 2008 12:31:38 -0600
To: bug-DateTime-Fiscal-Year [...] rt.cpan.org
From: Jay Hannah <jay [...] jays.net>
On Jan 15, 2008, at 11:51 AM, Jesse Shy via RT wrote: Show quoted text
> That is correct, companies declare a date as the beginning of the > fiscal > year. The way you have it, Dec 24th of 2007 would be the first day > of fy > 2008 and fy 2007 would only be 364 days long. Does this clarify?
An no one cares that what days are in each "fiscal week" changes year over year? Just curious. Thanks, j
Subject: Re: [rt.cpan.org #32301] Work week shifts incorrectly when 2008 starts
Date: Tue, 15 Jan 2008 15:11:41 -0600
To: bug-DateTime-Fiscal-Year [...] rt.cpan.org
From: "Jesse Shy" <jesseshy [...] gmail.com>
Jay, I sent to you jays.net email. On Jan 15, 2008 12:31 PM, Jay Hannah via RT < bug-DateTime-Fiscal-Year@rt.cpan.org> wrote: Show quoted text
> > Queue: DateTime-Fiscal-Year > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=32301 > > > On Jan 15, 2008, at 11:51 AM, Jesse Shy via RT wrote:
> > That is correct, companies declare a date as the beginning of the > > fiscal > > year. The way you have it, Dec 24th of 2007 would be the first day > > of fy > > 2008 and fy 2007 would only be 364 days long. Does this clarify?
> > An no one cares that what days are in each "fiscal week" changes year > over year? > > Just curious. Thanks, > > j > > >