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

Class ShiftInstance is an instance of a Shift. More...

Public Member Functions

def __init__ (self, Shift shift, datetime startDateTime, team)
 Construct an instance of a shift. More...
 
datetime getEndTime (self)
 Get the ending date and time of day. More...
 
int compareTo (self, other)
 Compare this shift to another such period by start date and time of day. More...
 
bool isInShiftInstance (self, datetime dateTime)
 Determine if this time falls within the shift instance period. More...
 
str __str__ (self)
 

Public Attributes

 shift
 
 startDateTime
 
 team
 

Detailed Description

Class ShiftInstance is an instance of a Shift.

A shift instance is worked by a Team.

Constructor & Destructor Documentation

◆ __init__()

def shift.ShiftInstance.__init__ (   self,
Shift  shift,
datetime  startDateTime,
  team 
)

Construct an instance of a shift.

Parameters
shiftShift definition
startDateTimeStarting date and time of day
team{link Team} working the shift instance

Member Function Documentation

◆ compareTo()

int shift.ShiftInstance.compareTo (   self,
  other 
)

Compare this shift to another such period by start date and time of day.

Parameters
otherOther shift instance
Returns
-1 if less than, 0 if equal and 1 if greater than

◆ getEndTime()

datetime shift.ShiftInstance.getEndTime (   self)

Get the ending date and time of day.

Returns
datetime when shift ends

◆ isInShiftInstance()

bool shift.ShiftInstance.isInShiftInstance (   self,
datetime  dateTime 
)

Determine if this time falls within the shift instance period.

Parameters
dateTimeDate and time to check
Returns
True if the specified time is in this shift instance

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