Skip Menu |

This queue is for tickets about the HTML-Calendar-Simple CPAN distribution.

Report information
The Basics
Id: 25130
Status: open
Priority: 0/
Queue: HTML-Calendar-Simple

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

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



Subject: Months starting at Sunday.. ALWAYS?
I am trying to use a simple program my $cal = HTML::Calendar::Simple->new({ month => 3, year => 2007 }); year print STDERR $cal; and I get: Mar 2007 Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 and I should remember that this months starts at a Thursday, not a Sunday. Also, this happens with all months I've tried :( Cheers ambs
Found the bug. you use the week days from strftime with a format("%a") call. The problem is when you have a different locale. Check this: [ambs@Diabelli tmp]$ perl _.pl Feb 2007 Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [ambs@Diabelli tmp]$ LC_ALL=C perl _.pl Feb 2007 Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [ambs@Diabelli tmp]$ Now, I am not sure how to fix it.
Attached a simple patch to solve this problem. Please let me know if/when you apply and release it. Cheers ambs
62a63,64 > my @reverse_days = (qw!_ Mon Tue Wed Thu Fri Sat Sun!); > 387c389 < my @seq = map $self->_spacer, (1 .. $days{$start->format("%a")}); --- > my @seq = map $self->_spacer, (1 .. $days{$reverse_days[$start->format("%u")]});