[-] BO : fixed bug in method displayDate() to the class Tools

This commit is contained in:
lLefevre
2011-10-06 09:17:56 +00:00
parent 69e58a9222
commit 1782dd2c63
+5 -6
View File
@@ -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
*