1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 22:57:14 +02:00

Fixes #3605 - Check for past/future difference in toDate()

and code clean-up
This commit is contained in:
Tijn Kuyper
2019-01-11 11:39:20 +01:00
parent 0445f9fa6c
commit 01263ef497
2 changed files with 15 additions and 21 deletions

View File

@@ -6,15 +6,12 @@
* Released under the terms and conditions of the
* GNU General Public License (http://gnu.org).
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/date_handler.php,v $
* $Revision$
* $Date$
* $Author$
*
*/
if (!defined('e107_INIT')) { exit; }
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php");
//e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php");
e107::lan('date');
class e_date
{
@@ -693,7 +690,16 @@ class e_date
return deftrue('LANDT_10',"Just now");
}
return ($mode ? $outputArray : implode(", ", $outputArray) . " " . LANDT_AGO);
// Check if it is 'past' or 'future'
if($older_date > $newer_date) // past
{
return ($mode ? $outputArray : implode(", ", $outputArray) . " " . LANDT_AGO);
}
else // future
{
return ($mode ? $outputArray : LANDT_IN ." ". implode(", ", $outputArray));
}
}