Skip Menu |

This queue is for tickets about the Time-Interval CPAN distribution.

Report information
The Basics
Id: 23828
Status: resolved
Worked: 23 min
Priority: 0/
Queue: Time-Interval

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

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



CC: root [...] cpan.org
Subject: Printing time interval for 0 seconds
Hi We are using $string = parseInterval(seconds => $var, String => 1); but sometimes we have $var holding a 0 (zero, no seconds). parseInterval does not crashes or something, but doesn't print anything. It would be great if it printed something like 0 seconds, or so. Cheers ambs
Hi. Here goes a patch to version 1.1 It solves: - printing 0 seconds - printing unitary values (1 second, 1 day, 1 hour, and so on) - added a 'Small' option to print data as '1d 20h 15m 35s' Please let me know when/if you apply it. THanks
diff Time-Interval-1.1/Interval.pm Time-Interval-1.1-mine/Interval.pm 103c103 < if ($p{'String'} != 0){ --- > if ($p{'Small'} != 0) { 107a108,119 > push (@temp, "$time{$_}".substr($_,0,1)); > } > } > return join (" ", @temp) || "0s"; > }elsif ($p{'String'} != 0){ > #return a string? > my @temp = (); > foreach ("days","hours","minutes","seconds"){ > if ($time{$_} > 0){ > if ($time{$_} == 1) { > push (@temp, "$time{$_} ".substr($_,0,-1)); > } else { 108a121 > } 111c124 < return (join (", ", @temp)); --- > return (join (", ", @temp)) || "0 seconds";
Subject: Re: [rt.cpan.org #23828] Printing time interval for 0 seconds
Date: Mon, 11 Dec 2006 09:25:01 -0500
To: bug-Time-Interval [...] rt.cpan.org
From: Andrew Hicox <andrew [...] hicox.com>
Alberto: thanks for the patch (and the bug report too)! I'll try to test this out and apply the patch later today or tomorrow. Unfortunately my professional schedule is getting in the way of my personal projects lately. thanks again for the patch, feel free to contribute code anytime, it's highly appreciated. -Andrew ;-) On Dec 9, 2006, at 4:51 PM, Alberto Simões via RT wrote: Show quoted text
> <Time-interval-1.1.diff>
Andrew N. Hicox Hicox Information Systems LLC Manassas, VA USA http://hicox.com andrew@hicox.com 703-367-9085
Subject: Re: [rt.cpan.org #23828] Printing time interval for 0 seconds
Date: Tue, 12 Dec 2006 10:49:10 -0500
To: bug-Time-Interval [...] rt.cpan.org
From: Andrew Hicox <andrew [...] hicox.com>
Alberto: I've applied your patch and rolled it into the current version of Time::Interval on CPAN. Since the CPAN mirrors take a while to update, I've attached the new version to this message. Thanks again for your contribution! -Andrew ;-)
Download Time-Interval-1.2.tar.gz
application/x-gzip 5.3k

Message body not shown because it is not plain text.

On Dec 9, 2006, at 4:51 PM, Alberto Simões via RT wrote: Show quoted text
> > Queue: Time-Interval > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=23828 > > > Hi. > > Here goes a patch to version 1.1 > It solves: > > - printing 0 seconds > - printing unitary values (1 second, 1 day, 1 hour, and so on) > - added a 'Small' option to print data as '1d 20h 15m 35s' > > Please let me know when/if you apply it. > > THanks > <Time-interval-1.1.diff>
Andrew N. Hicox Hicox Information Systems LLC Manassas, VA USA http://hicox.com andrew@hicox.com 703-367-9085
CC: root [...] cpan.org
Subject: Re: [rt.cpan.org #23828] Printing time interval for 0 seconds
Date: Tue, 12 Dec 2006 15:55:34 +0000
To: bug-Time-Interval [...] rt.cpan.org
From: Alberto Simões <ambs [...] cpan.org>
Thank you for applying it :-) Cheers Alberto Andrew Hicox via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=23828 > > > > Alberto: > > I've applied your patch and rolled it into the current version of > Time::Interval on CPAN. > Since the CPAN mirrors take a while to update, I've attached the new > version to this message. > > Thanks again for your contribution! > > -Andrew ;-) > > > ------------------------------------------------------------------------ > > > > > On Dec 9, 2006, at 4:51 PM, Alberto Sim?es via RT wrote: >
>> Queue: Time-Interval >> Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=23828 > >> >> Hi. >> >> Here goes a patch to version 1.1 >> It solves: >> >> - printing 0 seconds >> - printing unitary values (1 second, 1 day, 1 hour, and so on) >> - added a 'Small' option to print data as '1d 20h 15m 35s' >> >> Please let me know when/if you apply it. >> >> THanks >> <Time-interval-1.1.diff>
> Andrew N. Hicox > Hicox Information Systems LLC > Manassas, VA USA > http://hicox.com > andrew@hicox.com > 703-367-9085
-- Alberto Simões - Departamento de Informática - Universidade do Minho Campus de Gualtar - 4710-057 Braga - Portugal "Beware of bugs in the above code; I have only proved it correct, not tried it." --- Donald Knuth