Open
Conversation
Open
88611e3 to
61a83e4
Compare
It was possible to encode shift that start at negative hour or hour bigger then 24. Of course this lead to some error at the moment we generate the planning for a given date - Add a constraint on start_time and end_time - Fix onchange on duration: duration was not computed properly when the start or end time was 00:00
61a83e4 to
6a36584
Compare
Codecov Report
@@ Coverage Diff @@
## 12.0 #292 +/- ##
==========================================
- Coverage 68.53% 68.53% -0.01%
==========================================
Files 107 107
Lines 3366 3369 +3
Branches 589 590 +1
==========================================
+ Hits 2307 2309 +2
Misses 951 951
- Partials 108 109 +1
Continue to review full report at Codecov.
|
robinkeunen
requested changes
Mar 15, 2022
| def _get_duration(self): | ||
| if self.start_time and self.end_time: | ||
| self.duration = self.end_time - self.start_time | ||
| self.duration = (self.end_time or 0.0) - (self.start_time or 0.0) |
Member
There was a problem hiding this comment.
I'd rather return False when start_time or end_time instead of these weird values.
Member
There was a problem hiding this comment.
Suggested change
| self.duration = (self.end_time or 0.0) - (self.start_time or 0.0) | |
| if self.start_time and self.end_time: | |
| self.duration = self.end_time - self.start_time | |
| else: | |
| self.duration = False | |
abc40d1 to
fa7679b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was possible to encode shift that start at negative hour
or hour bigger then 24. Of course this lead to some
error at the moment we generate the planning for a given date
when the start or end time was 00:00