diff options
-rw-r--r-- | core/Date.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/Date.php b/core/Date.php index a47fc03c73..bac8ce7db2 100644 --- a/core/Date.php +++ b/core/Date.php @@ -659,6 +659,10 @@ class Date */ protected function replaceLegacyPlaceholders($template) { + if (strpos($template, '%') === false) { + return $template; + } + $mapping = array( '%day%' => 'd', '%shortMonth%' => 'MMM', @@ -774,7 +778,13 @@ class Date ); /** - * Parses the datetime format pattern. + * Parses the datetime format pattern and returns a tokenized result array + * + * Examples: + * Input Output + * 'dd.mm.yyyy' array(array('dd'), '.', array('mm'), '.', array('yyyy')) + * 'y?M?d?EEEE ah:mm:ss' array(array('y'), '?', array('M'), '?', array('d'), '?', array('EEEE'), ' ', array('a'), array('h'), ':', array('mm'), ':', array('ss')) + * * @param string $pattern the pattern to be parsed * @return array tokenized parsing result */ |