Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
d50bee3c
Commit
d50bee3c
authored
6 years ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
solved problem when adding ranges of availability
parent
3225847d
No related branches found
No related tags found
1 merge request
!171
Feature/daily availability
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/officeAvailability.py
+4
-3
4 additions, 3 deletions
smash/web/officeAvailability.py
with
4 additions
and
3 deletions
smash/web/officeAvailability.py
+
4
−
3
View file @
d50bee3c
...
@@ -3,7 +3,6 @@ import datetime
...
@@ -3,7 +3,6 @@ import datetime
from
datetime
import
timedelta
from
datetime
import
timedelta
import
logging
import
logging
import
pandas
as
pd
import
pandas
as
pd
from
web.utils
import
get_today_midnight_date
from
web.utils
import
get_today_midnight_date
from
web.models.holiday
import
Holiday
from
web.models.holiday
import
Holiday
from
web.models.availability
import
Availability
from
web.models.availability
import
Availability
...
@@ -59,8 +58,9 @@ class OfficeAvailability(object):
...
@@ -59,8 +58,9 @@ class OfficeAvailability(object):
Receives a pandas date_range `pd.date_range` object.
Receives a pandas date_range `pd.date_range` object.
Sets the availability to one for the specific interval of the provided range.
Sets the availability to one for the specific interval of the provided range.
'''
'''
range
=
range
.
round
(
self
.
minimum_slot
)
if
only_working_hours
:
if
only_working_hours
:
range
=
range
.
to_series
().
between_time
(
self
.
office_start
,
self
.
office_end
)
range
=
range
.
to_series
().
between_time
(
self
.
office_start
,
self
.
office_end
)
.
index
self
.
availability
[
range
]
=
1
self
.
availability
[
range
]
=
1
def
remove_availability
(
self
,
range
,
only_working_hours
=
False
):
def
remove_availability
(
self
,
range
,
only_working_hours
=
False
):
...
@@ -68,8 +68,9 @@ class OfficeAvailability(object):
...
@@ -68,8 +68,9 @@ class OfficeAvailability(object):
Receives a pandas date_range `pd.date_range` object.
Receives a pandas date_range `pd.date_range` object.
Sets the availability to zero for the specific interval of the provided range.
Sets the availability to zero for the specific interval of the provided range.
'''
'''
range
=
range
.
round
(
self
.
minimum_slot
)
if
only_working_hours
:
if
only_working_hours
:
range
=
range
.
to_series
().
between_time
(
self
.
office_start
,
self
.
office_end
)
range
=
range
.
to_series
().
between_time
(
self
.
office_start
,
self
.
office_end
)
.
index
self
.
availability
[
range
]
=
0
self
.
availability
[
range
]
=
0
def
consider_this
(
self
,
appointment_availability_or_holiday
,
only_working_hours
=
False
):
def
consider_this
(
self
,
appointment_availability_or_holiday
,
only_working_hours
=
False
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment