PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.0.3
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.0.3
5.13.0 5.12.1 5.12.0 5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / Period / Day.php
matomo / app / core / Period Last commit date
Day.php 2 years ago Factory.php 2 years ago Month.php 2 years ago PeriodValidator.php 2 years ago Range.php 2 years ago Week.php 2 years ago Year.php 2 years ago
Day.php
99 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 *
9 */
10 namespace Piwik\Period;
11
12 use Exception;
13 use Piwik\Date;
14 use Piwik\Period;
15 /**
16 */
17 class Day extends Period
18 {
19 const PERIOD_ID = 1;
20 protected $label = 'day';
21 /**
22 * Returns the day of the period as a string
23 *
24 * @return string
25 */
26 public function getPrettyString()
27 {
28 $out = $this->getDateStart()->toString();
29 return $out;
30 }
31 /**
32 * Returns the day of the period as a localized short string
33 *
34 * @return string
35 */
36 public function getLocalizedShortString()
37 {
38 //"Mon 15 Aug"
39 $date = $this->getDateStart();
40 $out = $date->getLocalized(Date::DATE_FORMAT_DAY_MONTH);
41 return $out;
42 }
43 /**
44 * Returns the day of the period as a localized long string
45 *
46 * @return string
47 */
48 public function getLocalizedLongString()
49 {
50 //"Mon 15 Aug"
51 $date = $this->getDateStart();
52 $out = $date->getLocalized(Date::DATE_FORMAT_LONG);
53 return $out;
54 }
55 /**
56 * Returns the number of subperiods
57 * Always 0, in that case
58 *
59 * @return int
60 */
61 public function getNumberOfSubperiods()
62 {
63 return 0;
64 }
65 /**
66 * Adds a subperiod
67 * Not supported for day periods
68 *
69 * @param $date
70 * @throws Exception
71 */
72 public function addSubperiod($date)
73 {
74 throw new Exception("Adding a subperiod is not supported for Day");
75 }
76 /**
77 * Returns the day of the period in the given format
78 *
79 * @param string $format
80 * @return string
81 */
82 public function toString($format = "Y-m-d")
83 {
84 return $this->date->toString($format);
85 }
86 public function __toString()
87 {
88 return $this->toString();
89 }
90 public function getImmediateChildPeriodLabel()
91 {
92 return null;
93 }
94 public function getParentPeriodLabel()
95 {
96 return 'week';
97 }
98 }
99