function __cronMonDaysFromWeekDays in Elysia Cron 6.2
Same name and namespace in other branches
- 5.2 elysia_cron_scheduler.inc \__cronMonDaysFromWeekDays()
- 5 elysia_cron_scheduler.inc \__cronMonDaysFromWeekDays()
- 6 elysia_cron_scheduler.inc \__cronMonDaysFromWeekDays()
- 7 elysia_cron_scheduler.inc \__cronMonDaysFromWeekDays()
1 call to __cronMonDaysFromWeekDays()
File
- ./
elysia_cron_scheduler.inc, line 156
Code
function __cronMonDaysFromWeekDays($year, $mon, $weekdays, $offset = 0) {
if ($mon > 12) {
$year++;
$mon = $mon - 12;
}
$result = array();
for ($i = 1; checkdate($mon, $i, $year); $i++) {
$w = date('w', mktime(12, 00, 00, $mon, $i, $year));
if (in_array($w, $weekdays)) {
$result[] = $i + $offset;
}
}
return $result;
}