PyShift Work Schedule
Work Schedule for Python
Public Member Functions | Public Attributes | List of all members
non_working_period.NonWorkingPeriod Class Reference

Class NonWorkingPeriod represents named non-working, non-recurring periods. More...

Inheritance diagram for non_working_period.NonWorkingPeriod:

Public Member Functions

def __init__ (self, str name, str description, datetime startDateTime, timedelta duration)
 Construct a non-working period. More...
 
def setStartDateTime (self, datetime startDateTime)
 Set period start date and time. More...
 
datetime getEndDateTime (self)
 Get period end date and time. More...
 
def setDuration (self, timedelta duration)
 Set duration. More...
 
str __str__ (self)
 
int compareTo (self, other)
 Compare two non-working periods. More...
 
bool isInPeriod (self, date day)
 Check to see if this day is contained in the non-working period. More...
 

Public Attributes

 startDateTime
 
 duration
 

Detailed Description

Class NonWorkingPeriod represents named non-working, non-recurring periods.

For example holidays and scheduled outages such as for preventive maintenance.

Constructor & Destructor Documentation

◆ __init__()

def non_working_period.NonWorkingPeriod.__init__ (   self,
str  name,
str  description,
datetime  startDateTime,
timedelta  duration 
)

Construct a non-working period.

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

Member Function Documentation

◆ compareTo()

int non_working_period.NonWorkingPeriod.compareTo (   self,
  other 
)

Compare two non-working periods.

Parameters
otherNonWorkingPeriod
Returns
-1 if starts before other, 0 is same starting times, else 1

◆ getEndDateTime()

datetime non_working_period.NonWorkingPeriod.getEndDateTime (   self)

Get period end date and time.

Returns
Period end

◆ isInPeriod()

bool non_working_period.NonWorkingPeriod.isInPeriod (   self,
date  day 
)

Check to see if this day is contained in the non-working period.

Parameters
dayDate to check
Returns
True if in the non-working period
Exceptions
ExceptionException

◆ setDuration()

def non_working_period.NonWorkingPeriod.setDuration (   self,
timedelta  duration 
)

Set duration.

Parameters
durationDuration

◆ setStartDateTime()

def non_working_period.NonWorkingPeriod.setStartDateTime (   self,
datetime  startDateTime 
)

Set period start date and time.

Parameters
startDateTimePeriod start

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