1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Handle dates passed wrong way round - thanks marj

This commit is contained in:
e107steved 2006-12-23 15:44:31 +00:00
parent e24a8d3109
commit 9ba42095d6

View File

@ -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();