blob: a5eda257edcc02267459b96955d6020f9a9c27ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
* @version $Id$
*
* @category Piwik
* @package Piwik
*/
/**
* @package Piwik
* @subpackage Piwik_Period
*/
class Piwik_Period_Day extends Piwik_Period
{
protected $label = 'day';
public function getPrettyString()
{
$out = $this->getDateStart()->toString() ;
return $out;
}
public function getLocalizedShortString()
{
//"Mon 15 Aug"
$date = $this->getDateStart();
$template = "%shortDay% %day% %shortMonth%";
$out = $date->getLocalized($template);
return $out;
}
public function getLocalizedLongString()
{
//"Mon 15 Aug"
$date = $this->getDateStart();
$template = "%longDay% %day% %longMonth% %longYear%";
$out = $date->getLocalized($template);
return $out;
}
public function getNumberOfSubperiods()
{
return 0;
}
public function addSubperiod( $date )
{
throw new Exception("Adding a subperiod is not supported for Piwik_Period_Day");
}
public function toString()
{
return $this->date->toString("Y-m-d");
}
public function __toString()
{
return $this->toString();
}
}
|