secondsToInterval has an inclusive interval comparison

This commit is contained in:
Colin Kuskie 2010-09-22 10:46:10 -07:00
parent 25181ae4db
commit ecbfc1a827
2 changed files with 14 additions and 12 deletions

View file

@ -828,7 +828,7 @@ sub secondsToInterval {
my $seconds = shift;
my $i18n = WebGUI::International->new($self->session, 'WebGUI');
for my $unit (sort { $b <=> $a } keys %intervals) {
if ($seconds > $unit) {
if ($seconds >= $unit) {
return (sprintf('%.0f', $seconds / $unit), $i18n->get($intervals{$unit}));
}
}