Index: openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl,v diff -u -r1.9.2.2 -r1.9.2.3 --- openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl 1 Jan 2006 19:44:38 -0000 1.9.2.2 +++ openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl 2 Jan 2006 20:41:33 -0000 1.9.2.3 @@ -30,18 +30,26 @@ @author Simon Carstensen } { - if {$diff < 120 && $diff > 60} { + set days [expr $diff / 1440] + if { $diff < 120 && $diff > 60 } { set to_return "1 hour and " - } elseif {$diff >= 60 && $diff < 1440} { + } elseif { $diff >= 60 && $days == 0 } { set to_return "[expr $diff / 60] hours and " } else { - set days [expr $diff / 1440] - if {$days eq "1"} { - set to_return "1 day, " - } else { - set to_return "$days days, " + switch $days { + "0" { + set to_return "" + } + "1" { + set to_return "1 day, " + } + default { + set to_return "$days days, " + } } - if { [expr $diff % 1440] < 60 } { + if { [expr $diff % 1440] < 60 && $days == 0 } { + append to_return "" + } elseif { [expr $diff % 1440] < 60 } { append to_return "and " } elseif { [expr $diff % 1440] < 120 } { append to_return "1 hour and "