Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schmidt <github@chsc.dk>2019-03-02 19:23:28 +0300
committerStefan Giehl <stefan@matomo.org>2019-03-02 19:23:28 +0300
commit17f95c216e966f0f4120cec6c2d7a2d37d81e031 (patch)
treecf1c669ac1e34274734f9cbed7db1519f71f69d7 /core/Date.php
parent0e3c30ba31790bbe2318b46a4e6fc7114b3c4e50 (diff)
Preserve case for CLDR month/day names (#14015)
Do ucfirst() on formatted date instead.
Diffstat (limited to 'core/Date.php')
-rw-r--r--core/Date.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/Date.php b/core/Date.php
index 3d1751591a..4c6ba7b6c7 100644
--- a/core/Date.php
+++ b/core/Date.php
@@ -10,6 +10,7 @@
namespace Piwik;
use Exception;
+use Piwik\Common;
use Piwik\Container\StaticContainer;
use Piwik\Intl\Data\Provider\DateTimeFormatProvider;
@@ -708,9 +709,10 @@ class Date
* The template should contain tags that will be replaced with localized date strings.
*
* @param string $template eg. `"MMM y"`
+ * @param bool $ucfirst whether the first letter should be upper-cased
* @return string eg. `"Aug 2009"`
*/
- public function getLocalized($template)
+ public function getLocalized($template, $ucfirst = true)
{
$dateTimeFormatProvider = StaticContainer::get('Piwik\Intl\Data\Provider\DateTimeFormatProvider');
@@ -729,6 +731,10 @@ class Date
}
}
+ if ($ucfirst) {
+ $out = Common::mb_strtoupper(mb_substr($out, 0, 1)) . mb_substr($out, 1);
+ }
+
return $out;
}