Add negative shifts in flex map logic and make it dynamic
This commit is contained in:
@@ -136,6 +136,14 @@ impl Day {
|
||||
!self.0.is_multiple_of(2)
|
||||
}
|
||||
|
||||
pub fn shift_types(&self) -> &[ShiftType] {
|
||||
if self.is_open_shift() {
|
||||
&[ShiftType::OpenFirst, ShiftType::OpenSecond]
|
||||
} else {
|
||||
&[ShiftType::Closed]
|
||||
}
|
||||
}
|
||||
|
||||
pub fn next(&self) -> Self {
|
||||
Self(self.0 + 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user