| Línea 133... |
Línea 133... |
| 133 |
$startweekday = calendar_get_starting_weekday();
|
133 |
$startweekday = calendar_get_starting_weekday();
|
| 134 |
$startmonthday = find_day_in_month($now['mday'] - ($numberofdaysinweek - 1), $startweekday, $now['mon'], $now['year']);
|
134 |
$startmonthday = find_day_in_month($now['mday'] - ($numberofdaysinweek - 1), $startweekday, $now['mon'], $now['year']);
|
| 135 |
$startmonth = $now['mon'];
|
135 |
$startmonth = $now['mon'];
|
| 136 |
$startyear = $now['year'];
|
136 |
$startyear = $now['year'];
|
| 137 |
if ($startmonthday > calendar_days_in_month($startmonth, $startyear)) {
|
137 |
if ($startmonthday > calendar_days_in_month($startmonth, $startyear)) {
|
| 138 |
list($startmonth, $startyear) = calendar_add_month($startmonth, $startyear);
|
138 |
[$startmonth, $startyear] = $calendartype->get_next_month($startyear, $startmonth);
|
| 139 |
$startmonthday = find_day_in_month(1, $startweekday, $startmonth, $startyear);
|
139 |
$startmonthday = find_day_in_month(1, $startweekday, $startmonth, $startyear);
|
| 140 |
}
|
140 |
}
|
| 141 |
$gregoriandate = $calendartype->convert_to_gregorian($startyear, $startmonth, $startmonthday);
|
141 |
$gregoriandate = $calendartype->convert_to_gregorian($startyear, $startmonth, $startmonthday);
|
| 142 |
$timestart = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'],
|
142 |
$timestart = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'],
|
| 143 |
$gregoriandate['hour'], $gregoriandate['minute']);
|
143 |
$gregoriandate['hour'], $gregoriandate['minute']);
|
| Línea 144... |
Línea 144... |
| 144 |
|
144 |
|
| 145 |
$endmonthday = $startmonthday + $numberofdaysinweek;
|
145 |
$endmonthday = $startmonthday + $numberofdaysinweek;
|
| 146 |
$endmonth = $startmonth;
|
146 |
$endmonth = $startmonth;
|
| 147 |
$endyear = $startyear;
|
147 |
$endyear = $startyear;
|
| 148 |
if ($endmonthday > calendar_days_in_month($endmonth, $endyear)) {
|
148 |
if ($endmonthday > calendar_days_in_month($endmonth, $endyear)) {
|
| 149 |
list($endmonth, $endyear) = calendar_add_month($endmonth, $endyear);
|
149 |
[$endmonth, $endyear] = $calendartype->get_next_month($endyear, $endmonth);
|
| 150 |
$endmonthday = find_day_in_month(1, $startweekday, $endmonth, $endyear);
|
150 |
$endmonthday = find_day_in_month(1, $startweekday, $endmonth, $endyear);
|
| 151 |
}
|
151 |
}
|
| 152 |
$gregoriandate = $calendartype->convert_to_gregorian($endyear, $endmonth, $endmonthday);
|
152 |
$gregoriandate = $calendartype->convert_to_gregorian($endyear, $endmonth, $endmonthday);
|
| 153 |
$timeend = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'],
|
153 |
$timeend = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'],
|
| Línea 157... |
Línea 157... |
| 157 |
$startweekday = calendar_get_starting_weekday();
|
157 |
$startweekday = calendar_get_starting_weekday();
|
| 158 |
$startmonthday = find_day_in_month($now['mday'] + 1, $startweekday, $now['mon'], $now['year']);
|
158 |
$startmonthday = find_day_in_month($now['mday'] + 1, $startweekday, $now['mon'], $now['year']);
|
| 159 |
$startmonth = $now['mon'];
|
159 |
$startmonth = $now['mon'];
|
| 160 |
$startyear = $now['year'];
|
160 |
$startyear = $now['year'];
|
| 161 |
if ($startmonthday > calendar_days_in_month($startmonth, $startyear)) {
|
161 |
if ($startmonthday > calendar_days_in_month($startmonth, $startyear)) {
|
| 162 |
list($startmonth, $startyear) = calendar_add_month($startmonth, $startyear);
|
162 |
[$startmonth, $startyear] = $calendartype->get_next_month($startyear, $startmonth);
|
| 163 |
$startmonthday = find_day_in_month(1, $startweekday, $startmonth, $startyear);
|
163 |
$startmonthday = find_day_in_month(1, $startweekday, $startmonth, $startyear);
|
| 164 |
}
|
164 |
}
|
| 165 |
$gregoriandate = $calendartype->convert_to_gregorian($startyear, $startmonth, $startmonthday);
|
165 |
$gregoriandate = $calendartype->convert_to_gregorian($startyear, $startmonth, $startmonthday);
|
| 166 |
$timestart = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'],
|
166 |
$timestart = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'],
|
| 167 |
$gregoriandate['hour'], $gregoriandate['minute']);
|
167 |
$gregoriandate['hour'], $gregoriandate['minute']);
|
| Línea 168... |
Línea 168... |
| 168 |
|
168 |
|
| 169 |
$endmonthday = $startmonthday + $numberofdaysinweek;
|
169 |
$endmonthday = $startmonthday + $numberofdaysinweek;
|
| 170 |
$endmonth = $startmonth;
|
170 |
$endmonth = $startmonth;
|
| 171 |
$endyear = $startyear;
|
171 |
$endyear = $startyear;
|
| 172 |
if ($endmonthday > calendar_days_in_month($endmonth, $endyear)) {
|
172 |
if ($endmonthday > calendar_days_in_month($endmonth, $endyear)) {
|
| 173 |
list($endmonth, $endyear) = calendar_add_month($endmonth, $endyear);
|
173 |
[$endmonth, $endyear] = $calendartype->get_next_month($endyear, $endmonth);
|
| 174 |
$endmonthday = find_day_in_month(1, $startweekday, $endmonth, $endyear);
|
174 |
$endmonthday = find_day_in_month(1, $startweekday, $endmonth, $endyear);
|
| 175 |
}
|
175 |
}
|
| 176 |
$gregoriandate = $calendartype->convert_to_gregorian($endyear, $endmonth, $endmonthday);
|
176 |
$gregoriandate = $calendartype->convert_to_gregorian($endyear, $endmonth, $endmonthday);
|
| 177 |
$timeend = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'],
|
177 |
$timeend = make_timestamp($gregoriandate['year'], $gregoriandate['month'], $gregoriandate['day'],
|
| Línea 185... |
Línea 185... |
| 185 |
$gregoriandate['hour'], $gregoriandate['minute']);
|
185 |
$gregoriandate['hour'], $gregoriandate['minute']);
|
| 186 |
$timeend = $timestart + (calendar_days_in_month($now['mon'], $now['year']) * DAYSECS);
|
186 |
$timeend = $timestart + (calendar_days_in_month($now['mon'], $now['year']) * DAYSECS);
|
| 187 |
break;
|
187 |
break;
|
| 188 |
case 'monthnext':
|
188 |
case 'monthnext':
|
| 189 |
// Get the next month for this calendar.
|
189 |
// Get the next month for this calendar.
|
| 190 |
list($nextmonth, $nextyear) = calendar_add_month($now['mon'], $now['year']);
|
190 |
[$nextmonth, $nextyear] = $calendartype->get_next_month($now['year'], $now['mon']);
|
| Línea 191... |
Línea 191... |
| 191 |
|
191 |
|
| 192 |
// Convert to gregorian.
|
192 |
// Convert to gregorian.
|
| Línea 193... |
Línea 193... |
| 193 |
$gregoriandate = $calendartype->convert_to_gregorian($nextyear, $nextmonth, 1);
|
193 |
$gregoriandate = $calendartype->convert_to_gregorian($nextyear, $nextmonth, 1);
|