function __cronMonDaysFromWeekDays in Elysia Cron 5
Same name and namespace in other branches
- 5.2 elysia_cron_scheduler.inc \__cronMonDaysFromWeekDays()
- 6.2 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 148
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;
}