add IntlDateFormatter for formatting locale-dependent date and time
This commit is contained in:
parent
34e304ded1
commit
3bebc9a35f
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,14 +19,6 @@
|
|||
*/
|
||||
class Utils
|
||||
{
|
||||
|
||||
/**
|
||||
* Format for printing the date
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DATEFORMAT = 'm.d.Y';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue