add IntlDateFormatter for formatting locale-dependent date and time
This commit is contained in:
parent
3024ca070e
commit
2f8960a86e
9 changed files with 47 additions and 18 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue