[-] BO : fixed bug in method displayDate() to the class Tools
This commit is contained in:
+5
-6
@@ -483,18 +483,17 @@ class ToolsCore
|
|||||||
* @param boolean $full With time or not (optional)
|
* @param boolean $full With time or not (optional)
|
||||||
* @return string Date
|
* @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;
|
return $date;
|
||||||
if (!Validate::isDate($date) OR !Validate::isBool($full))
|
if (!Validate::isDate($date) || !Validate::isBool($full))
|
||||||
die (self::displayError('Invalid date'));
|
die (self::displayError('Invalid date'));
|
||||||
|
|
||||||
$language = Language::getLanguage((int)$id_lang);
|
$context = Context::getContext();
|
||||||
return date($full ? $language['date_format_full'] : $language['date_format_lite'], $time);
|
return date($full ? $context->language->date_format_full : $context->language->date_format_lite, $time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanitize a string
|
* Sanitize a string
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user