function _cronMonDaysFromWeekDays in Elysia Cron 7.2
Same name and namespace in other branches
- 5.2 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
- 5 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
- 6.2 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
- 6 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
- 7 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
Helper function for _elysia_cron_next_run().
1 call to _cronMonDaysFromWeekDays()
- _cronDecodeRuleMday in ./
elysia_cron_scheduler.inc - Helper function for _elysia_cron_next_run().
File
- ./
elysia_cron_scheduler.inc, line 187 - Schedules cron runs.
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;
}