The date time format can be chosen in application settings

This commit is contained in:
Frederic Guillot
2016-02-06 18:08:41 -05:00
parent fc785bbbf6
commit 58cef28967
69 changed files with 597 additions and 623 deletions

View File

@@ -146,32 +146,6 @@ class Translator
return $str;
}
/**
* Get a formatted datetime
*
* $translator->datetime('%Y-%m-%d', time());
*
* @access public
* @param string $format Format defined by the strftime function
* @param integer $timestamp Unix timestamp
* @return string
*/
public function datetime($format, $timestamp)
{
if (! $timestamp) {
return '';
}
$format = $this->get($format, $format);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$format = str_replace('%e', '%d', $format);
$format = str_replace('%k', '%H', $format);
}
return strftime($format, (int) $timestamp);
}
/**
* Get an identifier from the translations or return the default
*
@@ -199,8 +173,6 @@ class Translator
*/
public static function load($language, $path = self::PATH)
{
setlocale(LC_TIME, $language.'.UTF-8', $language);
$filename = $path.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'translations.php';
if (file_exists($filename)) {