Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
cdaaaeee
Commit
cdaaaeee
authored
Aug 24, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow the definition of shift in weekends
parent
07cb738f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
18 deletions
+25
-18
dream/plugins/JobShop/ReadJSShifts.py
dream/plugins/JobShop/ReadJSShifts.py
+25
-18
No files found.
dream/plugins/JobShop/ReadJSShifts.py
View file @
cdaaaeee
...
...
@@ -188,6 +188,13 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
# calculate the number of days till the end of the exception
else
:
exceptionDay
=
math
.
floor
((
exception
[
-
1
]
-
hoursToEndFirstDay
.
total_seconds
()
/
3600
)
/
24
)
+
1
# check the weekday
exceptionDate
=
now
+
datetime
.
timedelta
(
days
=
exceptionDay
)
# if it is weekend create shift entry for that date. The default pattern does not need to be changed
if
exceptionDate
.
weekday
()
in
[
5
,
6
]:
defaultShiftPattern
[
node
].
append
(
exception
)
# for exceptions in weekdays
else
:
for
index2
,
default
in
enumerate
(
defaultShiftPattern
[
node
]):
# check if we still are in the first day
if
hoursToEndFirstDay
.
total_seconds
()
/
3600
>
default
[
-
1
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment