1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-08 15:46:44 +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 * Released under the terms and conditions of the
* GNU General Public License (http://gnu.org). * 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; } 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 class e_date
{ {
@@ -693,8 +690,17 @@ class e_date
return deftrue('LANDT_10',"Just now"); return deftrue('LANDT_10',"Just now");
} }
// Check if it is 'past' or 'future'
if($older_date > $newer_date) // past
{
return ($mode ? $outputArray : implode(", ", $outputArray) . " " . LANDT_AGO); return ($mode ? $outputArray : implode(", ", $outputArray) . " " . LANDT_AGO);
} }
else // future
{
return ($mode ? $outputArray : LANDT_IN ." ". implode(", ", $outputArray));
}
}
/** /**

View File

@@ -1,14 +1,4 @@
<?php <?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_date.php,v $
| $Revision$
| $Date$
| $Author$
+----------------------------------------------------------------------------+
*/
define("LANDT_01", "year"); define("LANDT_01", "year");
define("LANDT_02", "month"); define("LANDT_02", "month");
@@ -30,8 +20,6 @@ define("LANDT_08s", "mins");
define("LANDT_09", "sec"); define("LANDT_09", "sec");
define("LANDT_09s", "secs"); define("LANDT_09s", "secs");
define("LANDT_AGO", "ago"); define("LANDT_AGO", "ago");
define("LANDT_IN", "in");
define("LANDT_10", "Just now"); define("LANDT_10", "Just now");
?>