This queue is for tickets about the Business-Hours CPAN distribution.

Report information
The Basics
Id:
124551
Status:
resolved
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
bitcardbmw [...] lsmod.de
Cc:
ppisar [...] redhat.com
AdminCc:

BugTracker
Severity:
Unimportant
Broken in:
0.12
Fixed in:
(no value)



Subject: timelocal should be called with 4-digit year
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
X-RT-Interface: Web
Message-ID: <rt-4.0.18-27645-1519398300-669.0-0-0@rt.cpan.org>
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1519398300-27645-2"
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
Content-Length: 214
man Time::Local says Whenever possible, use an absolute four digit year instead. With a detailed explanation about ambiguity of 2-digit years above that. Please review/test/merge the attached patch (not tested)
Subject: fix.patch
MIME-Version: 1.0
Content-Type: text/x-patch; name="fix.patch"
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline; filename="fix.patch"
Content-Transfer-Encoding: binary
Content-Length: 554
Index: Business-Hours-0.12/lib/Business/Hours.pm =================================================================== --- Business-Hours-0.12.orig/lib/Business/Hours.pm +++ Business-Hours-0.12/lib/Business/Hours.pm @@ -273,7 +273,7 @@ sub for_timespan { # began. my @start = localtime( $args{'Start'} ); my $month = $start[4]; - my $year = $start[5]; + my $year = $start[5] + 1900; my $first_sunday = $start[3] - $start[6]; # period_start is time_t at midnight local time on the first sunday
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-27645-1519398300-669.0-0-0@rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-27645-1519398300-669.0-0-0@rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-22768-1546867530-1511.124551-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1103
Dne Pá 23.úno.2018 10:05:00, bmwiedemann napsal(a):
Show quoted text
> man Time::Local says > > Whenever possible, use an absolute four digit year instead. > > With a detailed explanation about ambiguity of 2-digit years above that. > > Please review/test/merge the attached patch (not tested)
t/1-business-hours.t fails now (after 2019-01-01T00:00:00): $ perl -Ilib t/1-business-hours.t 1..17 ok 1 - use Business::Hours; ok 2 ok 3 not ok 4 # Failed test at t/1-business-hours.t line 16. # got: '0' # expected: '162000' ok 5 not ok 6 - Got seconds # Failed test 'Got seconds' # at t/1-business-hours.t line 24. not ok 7 # Failed test at t/1-business-hours.t line 27. # got: '0' # expected: '162000' not ok 8 # Failed test at t/1-business-hours.t line 50. # got: '374400' # expected: '28800' ok 9 ok 10 ok 11 ok 12 Set::IntSpan::_copy_run_list: Bad order 2: 72000--1 at lib/Business/Hours.pm line 270. # Looks like your test exited with 255 just after 12. There is a discussion at Time-Local issue tracker <https://github.com/houseabsolute/Time-Local/issues/8>.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-27645-1519398300-669.0-0-0@rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-27645-1519398300-669.0-0-0@rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-21799-1547242266-460.124551-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 117
We published a new version to CPAN with some fixes that should resolve the errors. Thanks for the bug reports! Jim


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.