diff options
author | sgiehl <stefan@piwik.org> | 2015-07-04 22:40:13 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-09-25 21:07:47 +0300 |
commit | 417880459ca14234d3fe1e811bf622b12f1ab57b (patch) | |
tree | 41bf9d374c6349591afae4e72b35391be1983b5b /core/Date.php | |
parent | 557c1b9bad6c7f7119dba49243eb641a9eb70778 (diff) |
use new date/time formats; use updated internal names
Diffstat (limited to 'core/Date.php')
-rw-r--r-- | core/Date.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/Date.php b/core/Date.php index 4fac9d8595..44c34ea0ba 100644 --- a/core/Date.php +++ b/core/Date.php @@ -41,6 +41,16 @@ class Date /** The default date time string format. */ const DATE_TIME_FORMAT = 'Y-m-d H:i:s'; + const DATETIME_FORMAT_LONG = 'Intl_Format_DateTime_Long'; + const DATETIME_FORMAT_SHORT = 'Intl_Format_DateTime_Short'; + const DATE_FORMAT_LONG = 'Intl_Format_Date_Long'; + const DATE_FORMAT_DAY_MONTH = 'Intl_Format_Date_Day_Month'; + const DATE_FORMAT_SHORT = 'Intl_Format_Date_Short'; + const DATE_FORMAT_MONTH_SHORT = 'Intl_Format_Month_Short'; + const DATE_FORMAT_MONTH_LONG = 'Intl_Format_Month_Long'; + const DATE_FORMAT_YEAR = 'Intl_Format_Year'; + const TIME_FORMAT = 'Intl_Format_Time'; + /** * Max days for months (non-leap-year). See {@link addPeriod()} implementation. * @@ -612,6 +622,11 @@ class Date { $template = $this->replaceLegacyPlaceholders($template); + if (substr($template, 0, 5) == 'Intl_') { + $translator = StaticContainer::get('Piwik\Translation\Translator'); + $template = $translator->translate($template); + } + $tokens = self::parseFormat($template); $out = ''; |