mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 07:36:32 +02:00
Fixes #3605 - Check for past/future difference in toDate()
and code clean-up
This commit is contained in:
@@ -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,7 +690,16 @@ class e_date
|
|||||||
return deftrue('LANDT_10',"Just now");
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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");
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
Reference in New Issue
Block a user