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
path: root/core
diff options
context:
space:
mode:
authorStefan Giehl <stefan@piwik.org>2017-07-17 00:49:20 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2017-07-17 00:49:20 +0300
commitb0546878bd83d5ca36d43a8db8ac903d8548dec1 (patch)
tree6426400bbe899b0add2214bb5e5ae7761a0b3bd5 /core
parentb9c953e43758815f016e11b96c9e7f6a303a8691 (diff)
Use localized format to display hour in Visits per time reports (#11747)
* Use localized format to display hour in Visits per time reports * updates cldr data * update test files
Diffstat (limited to 'core')
-rw-r--r--core/Date.php10
-rw-r--r--core/Intl/Data/Provider/DateTimeFormatProvider.php10
2 files changed, 19 insertions, 1 deletions
diff --git a/core/Date.php b/core/Date.php
index dd2051a1a0..64583c9814 100644
--- a/core/Date.php
+++ b/core/Date.php
@@ -725,6 +725,14 @@ class Date
return $this->toString('h');
case "h":
return $this->toString('g');
+ case "KK": // 00 .. 11
+ return str_pad($this->toString('g') - 1, 2, '0');
+ case "K": // 0 .. 11
+ return $this->toString('g') - 1;
+ case "kk": // 01 .. 24
+ return str_pad($this->toString('G') + 1, 2, '0');
+ case "k": // 1 .. 24
+ return $this->toString('G') + 1;
// minute
case "mm":
case "m":
@@ -755,7 +763,7 @@ class Date
}
protected static $tokens = array(
- 'G', 'y', 'M', 'L', 'd', 'h', 'H', 'm', 's', 'E', 'c', 'e', 'D', 'F', 'w', 'W', 'a', 'z', 'Z', 'v',
+ 'G', 'y', 'M', 'L', 'd', 'h', 'H', 'k', 'K', 'm', 's', 'E', 'c', 'e', 'D', 'F', 'w', 'W', 'a', 'z', 'Z', 'v',
);
/**
diff --git a/core/Intl/Data/Provider/DateTimeFormatProvider.php b/core/Intl/Data/Provider/DateTimeFormatProvider.php
index 90ffad609f..daf22b0b8c 100644
--- a/core/Intl/Data/Provider/DateTimeFormatProvider.php
+++ b/core/Intl/Data/Provider/DateTimeFormatProvider.php
@@ -65,6 +65,16 @@ class DateTimeFormatProvider
}
/**
+ * Returns if time is present as 12 hour clock (eg am/pm)
+ *
+ * @return bool
+ */
+ public function uses12HourClock()
+ {
+ return false;
+ }
+
+ /**
* Returns interval format pattern for the given format type
*
* @param bool $short whether to return short or long format pattern