Commit 9fc605a3 authored by Sean Arnold's avatar Sean Arnold

Add changelog file

parent 08b98240
---
title: Allow overnight shifts for oncall rotations
merge_request: 57202
author:
type: added
......@@ -129,15 +129,10 @@ module IncidentManagement
# expected_shift_count = 14 -> pretend it's a 2-week rotation
# shift_count = 2 -> we're calculating the shift for the 3rd day
# starts_at = Monday 00:00:00 + 8.hours + 2.days => Thursday 08:00:00
start_date = shift_cycle_starts_at + shift_count.days
start_date = end_date = shift_cycle_starts_at + shift_count.days
end_date = start_date + 1.day unless rotation.active_period.end_after_start?
shift_start_date, shift_end_date = if rotation.active_period.end_after_start?
[start_date, start_date]
else
[start_date, start_date + 1.day]
end
starts_at, ends_at = rotation.active_period.for_dates(shift_start_date, shift_end_date)
starts_at, ends_at = rotation.active_period.for_dates(start_date, end_date)
shift_for(participant, [rotation.starts_at, starts_at].max, limit_end_time(ends_at))
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment