add IntlDateFormatter for formatting locale-dependent date and time

This commit is contained in:
coderkun 2014-01-25 20:22:54 +01:00
commit 3bebc9a35f
9 changed files with 47 additions and 18 deletions

View file

@ -82,6 +82,20 @@
// Create linker
$this->linker = new \nre\core\Linker($this->request);
// Create date and time formatter
$this->set('dateFormatter', new \IntlDateFormatter(
\nre\core\Config::getDefault('locale'),
\IntlDateFormatter::MEDIUM,
\IntlDateFormatter::NONE,
NULL
));
$this->set('timeFormatter', new \IntlDateFormatter(
\nre\core\Config::getDefault('locale'),
\IntlDateFormatter::NONE,
\IntlDateFormatter::SHORT,
NULL
));
// Set userdata
$this->set('loggedUser', static::$user);
}

View file

@ -19,14 +19,6 @@
*/
class Utils
{
/**
* Format for printing the date
*
* @var string
*/
const DATEFORMAT = 'm.d.Y';
}
?>