You are here

function _cronMonDaysFromWeekDays in Elysia Cron 6

Same name and namespace in other branches
  1. 5.2 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
  2. 5 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
  3. 6.2 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
  4. 7.2 elysia_cron_scheduler.inc \_cronMonDaysFromWeekDays()
  5. 7 elysia_cron_scheduler_old.inc \_cronMonDaysFromWeekDays()
1 call to _cronMonDaysFromWeekDays()
elysia_cron_should_run in ./elysia_cron_scheduler_old.inc

File

./elysia_cron_scheduler_old.inc, line 120

Code

function _cronMonDaysFromWeekDays($year, $mon, $weekdays) {
  $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;
    }
  }
  return $result;
}