From 9ba42095d6ecdb7ab3e70417b302c882122fa5d5 Mon Sep 17 00:00:00 2001 From: e107steved Date: Sat, 23 Dec 2006 15:44:31 +0000 Subject: [PATCH] Handle dates passed wrong way round - thanks marj --- e107_handlers/date_handler.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/e107_handlers/date_handler.php b/e107_handlers/date_handler.php index 70329d879..6b669585b 100644 --- a/e107_handlers/date_handler.php +++ b/e107_handlers/date_handler.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/date_handler.php,v $ -| $Revision: 1.2 $ -| $Date: 2006-12-22 20:46:53 $ +| $Revision: 1.3 $ +| $Date: 2006-12-23 15:44:31 $ | $Author: e107steved $ | +----------------------------------------------------------------------------+ @@ -75,6 +75,12 @@ class convert If start day > end day, we cross a month boundary. Calculate last day of start date. Otherwise we can just do a simple difference. */ $newer_date = ($newer_date == FALSE ? (time()) : $newer_date); + if($older_date>$newer_date) + { // Just in case the wrong way round + $tmp=$newer_date; + $newer_date=$older_date; + $older_date=$tmp; + } $new_date = getdate($newer_date); $old_date = getdate($older_date); $result = array();