public function week_days($year = FALSE, $week = FALSE) { $w = date::week($year, $week); $list = array(); for ($day = 0; $day <= 6; $day++) { $list[] = date('Y-m-d', strtotime($w['year'] . "W" . $w['week'] . $day)); } return $list; }
public static function last_day_of_week($year = null, $month = null, $week = null, $format = 'j') { if ($year === null) { $year = date::year(); } if ($month === null) { $month = date::month(); } if ($week === null) { $week = date::week(); } if ($week == date::weeks_in_month($year, $month)) { return date::last_day_of_month($year, $month, $format); } if ($week > date::weeks_in_month($year, $month)) { return 0; } return date($format, strtotime('this sunday', date::first_day_of_week($year, $month, $week, 'U'))); }