PyShift Work Schedule
Work Schedule for Python
Loading...
Searching...
No Matches
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

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

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__()

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()

non_working_period.NonWorkingPeriod.setDuration ( self,
timedelta duration )

Set duration.

Parameters
durationDuration

◆ setStartDateTime()

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: