From 1782dd2c63eb29cef0f2e00f2e9f9202ed4dcf39 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Thu, 6 Oct 2011 09:17:56 +0000 Subject: [PATCH] [-] BO : fixed bug in method displayDate() to the class Tools --- classes/Tools.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 184bb1a0b..a97b2148f 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -483,18 +483,17 @@ class ToolsCore * @param boolean $full With time or not (optional) * @return string Date */ - public static function displayDate($date, $id_lang, $full = false, $separator='-') + public static function displayDate($date, $id_lang, $full = false, $separator = '-') { - if (!$date OR !($time = strtotime($date))) + if (!$date || !($time = strtotime($date))) return $date; - if (!Validate::isDate($date) OR !Validate::isBool($full)) + if (!Validate::isDate($date) || !Validate::isBool($full)) die (self::displayError('Invalid date')); - $language = Language::getLanguage((int)$id_lang); - return date($full ? $language['date_format_full'] : $language['date_format_lite'], $time); + $context = Context::getContext(); + return date($full ? $context->language->date_format_full : $context->language->date_format_lite, $time); } - /** * Sanitize a string *