];
}
+ public static function getWeekRangeForDate($date = null)
+ {
+ $date = $date ?? date('Y-m-d');
+
+ $day = date('d', $date);
+ $month = date('m', $date);
+ $year = date('m', $date);
+
+ $weekNumber = intdiv($day - 1, 7) + 1;
+
+ $startDay = ($weekNumber - 1) * 7 + 1;
+ $endDay = min($weekNumber * 7, date('t'));
+
+ $startDate = \DateTime::createFromFormat('Y-m-d', "$year-$month-$startDay");
+ $endDate = \DateTime::createFromFormat('Y-m-d', "$year-$month-$endDay");
+
+ return [
+ 'start_time' => $startDate->format('Y-m-d'),
+ 'end_time' => $endDate->format('Y-m-d'),
+ ];
+ }
++
+ public static function getAdjustmentEditors() {
+ return array(
+ AdminGroup::GROUP_IT,
+ AdminGroup::GROUP_OPERATIONAL_DIRECTOR,
+ AdminGroup::DIRECTOR
+ );
+ }
}