PyShift Work Schedule
Work Schedule for Python
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
time_period.TimePeriod Class Reference

Class TimePeriod is a named period of time with a specified duration and starting time of day. More...

Inheritance diagram for time_period.TimePeriod:

Public Member Functions

 __init__ (self, str name, str description, time startTime, timedelta duration)
 Construct a time period.
 
 setDuration (self, timedelta duration)
 Set duration.
 
time timePlus (self, time dayTime, timedelta duration)
 add duration to a time of day
 
time getEndTime (self)
 Get period end.
 
 setStartTime (self, time startTime)
 Set period start time.
 
str __str__ (self)
 

Public Attributes

 duration
 
 startTime
 

Static Public Attributes

int SECONDS_PER_DAY = 24 * 60 * 60
 

Detailed Description

Class TimePeriod is a named period of time with a specified duration and starting time of day.

Constructor & Destructor Documentation

◆ __init__()

time_period.TimePeriod.__init__ ( self,
str name,
str description,
time startTime,
timedelta duration )

Construct a time period.

Parameters
nameName of period
descriptionDescription of period
startTimeStarting date and time of day
durationDuration of time period

Member Function Documentation

◆ getEndTime()

time time_period.TimePeriod.getEndTime ( self)

Get period end.

Returns
End time of day

◆ setDuration()

time_period.TimePeriod.setDuration ( self,
timedelta duration )

Set duration.

Parameters
durationperiod duration as timedelta

◆ setStartTime()

time_period.TimePeriod.setStartTime ( self,
time startTime )

Set period start time.

Parameters
startTimeStarting time of day

◆ timePlus()

time time_period.TimePeriod.timePlus ( self,
time dayTime,
timedelta duration )

add duration to a time of day

Parameters
dayTimetime of day
durationduration to add
Returns
new time

The documentation for this class was generated from the following file: