3 * Argument handler for a full date (CCYYMMDD)
5 class views_handler_argument_node_created_fulldate
extends views_handler_argument_date
{
7 * Constructor implementation
11 $this->format
= 'F j, Y';
12 $this->arg_format
= 'Ymd';
13 $this->formula
= views_date_sql_format($this->arg_format
, "***table***.$this->real_field");
17 * Provide a link to the next level of the view
19 function summary_name($data) {
20 $created = $data->{$this->name_alias
};
21 return format_date(strtotime($created), 'custom', $this->format
, 0);
25 * Provide a link to the next level of the view
28 return format_date(strtotime($this->argument
), 'custom', $this->format
, 0);
33 * Argument handler for a year (CCYY)
35 class views_handler_argument_node_created_year
extends views_handler_argument_date
{
37 * Constructor implementation
39 function construct() {
41 $this->arg_format
= 'Y';
42 $this->formula
= views_date_sql_extract('YEAR', "***table***.$this->real_field");
47 * Argument handler for a year plus month (CCYYMM)
49 class views_handler_argument_node_created_year_month
extends views_handler_argument_date
{
51 * Constructor implementation
53 function construct() {
55 $this->format
= 'F Y';
56 $this->arg_format
= 'Ym';
57 $this->formula
= views_date_sql_format($this->arg_format
, "***table***.$this->real_field");
61 * Provide a link to the next level of the view
63 function summary_name($data) {
64 $created = $data->{$this->name_alias
};
65 return format_date(strtotime($created .
"15"), 'custom', $this->format
, 0);
69 * Provide a link to the next level of the view
72 return format_date(strtotime($this->argument .
"15"), 'custom', $this->format
, 0);
77 * Argument handler for a month (MM)
79 class views_handler_argument_node_created_month
extends views_handler_argument_date
{
81 * Constructor implementation
83 function construct() {
85 $this->formula
= views_date_sql_extract('MONTH', "***table***.$this->real_field");
87 $this->arg_format
= 'm';
91 * Provide a link to the next level of the view
93 function summary_name($data) {
94 $month = str_pad($data->{$this->name_alias
}, 2, '0', STR_PAD_LEFT
);
95 return format_date(strtotime("2005" .
$month .
"15"), 'custom', $this->format
);
99 * Provide a link to the next level of the view
102 $month = str_pad($this->argument
, 2, '0', STR_PAD_LEFT
);
103 return format_date(strtotime("2005" .
$month .
"15"), 'custom', $this->format
, 0);
106 function summary_argument($data) {
107 // Make sure the argument contains leading zeroes.
108 return str_pad($data->{$this->base_alias
}, 2, '0', STR_PAD_LEFT
);
113 * Argument handler for a day (DD)
115 class views_handler_argument_node_created_day
extends views_handler_argument_date
{
117 * Constructor implementation
119 function construct() {
121 $this->formula
= views_date_sql_extract('DAY', "***table***.$this->real_field");
123 $this->arg_format
= 'd';
127 * Provide a link to the next level of the view
129 function summary_name($data) {
130 $day = str_pad($data->{$this->name_alias
}, 2, '0', STR_PAD_LEFT
);
131 return format_date(strtotime("2005" .
"05" .
$day), 'custom', $this->format
, 0);
135 * Provide a link to the next level of the view
138 $day = str_pad($this->argument
, 2, '0', STR_PAD_LEFT
);
139 return format_date(strtotime("2005" .
"05" .
$day), 'custom', $this->format
, 0);
142 function summary_argument($data) {
143 // Make sure the argument contains leading zeroes.
144 return str_pad($data->{$this->base_alias
}, 2, '0', STR_PAD_LEFT
);
149 * Argument handler for a week.
151 class views_handler_argument_node_created_week
extends views_handler_argument_date
{
153 * Constructor implementation
155 function construct() {
157 $this->arg_format
= 'w';
158 $this->formula
= views_date_sql_extract('WEEK', "***table***.$this->real_field");
162 * Provide a link to the next level of the view
164 function summary_name($data) {
165 $created = $data->{$this->name_alias
};
166 return t('Week @week', array('@week' => $created));