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.1 -r1.9.2.2 --- openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl 29 Dec 2005 22:54:19 -0000 1.9.2.1 +++ openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl 1 Jan 2006 19:44:38 -0000 1.9.2.2 @@ -1,9 +1,10 @@ ad_library { - Procs used by the News Aggregator application. - - @author Simon Carstensen (simon@bcuni.net) - @author Guan Yang (guan@unicast.org) - @creation-date 2003-06-28 + Procs used by the News Aggregator application. + + @author Simon Carstensen (simon@bcuni.net) + @author Guan Yang (guan@unicast.org) + @creation-date 2003-06-28 + @cvs-id $Id$ } @@ -34,11 +35,19 @@ } elseif {$diff >= 60 && $diff < 1440} { set to_return "[expr $diff / 60] hours and " } else { - if {$diff >= 1440 && $diff <2880} { - set to_return "1 day, [expr $diff / 60] hours and " + set days [expr $diff / 1440] + if {$days eq "1"} { + set to_return "1 day, " } else { - set to_return "[expr $diff / 1440] days, [expr [expr $diff % 1440] / 60] hours and " + set to_return "$days days, " } + if { [expr $diff % 1440] < 60 } { + append to_return "and " + } elseif { [expr $diff % 1440] < 120 } { + append to_return "1 hour and " + } else { + append to_return "[expr [expr $diff % 1440] / 60] hours and " + } } set mins [expr $diff % 60]