Class AppointmentSlicer

Slices appointments into single entities that are within a single day. This class is essential when having calender data (with entries possibly spanning several days), which you would like to display in the calender control (which only accepts data for single days).

Constructors

AppointmentSlicer()

Default constructor.

Declaration

AppointmentSlicer

Examples

AppointmentSlicer a;

a.addAppointment(1, DateTime(2017, 4, 23, 8, 0, 0), DateTime(2017, 4, 23, 10, 30, 0), "Meeting");

Methods

addAppointment(Integer,DateTime,DateTime,String)

Adds an appointment to the class.

Declaration

addAppointment(Integer id, DateTime start, DateTime end, String title)

Parameters

Type Name Description
Integer id The ID of the appointment (can be retrieved later).
DateTime title The title of the appointment.
DateTime start When the appointment starts.
String stop When the appointment ends.

Returns

Type Description

clear()

Clears all the added appointments from the instance.

Declaration

Void clear()

Returns

Type Description

eof()

Returns true if the internal iterator is past the appointments for the chosen day; otherwise, false.

Declaration

Bool eof()

Returns

Type Description
Bool True if the internal iterator is past the appointments for the chosen day; otherwise, false.

getLoadForDay(Date,Time,Time,Integer)

Returns the accumulated load for a given day.

Declaration

Integer getLoadForDay(Date day, Time start, Time stop, Integer max)

Parameters

Type Name Description
Date day The day to get the load for.
Time start When to start calculating.
Time stop When to stop calculating.
Integer max The maximum time returned.

Returns

Type Description
Integer The calculated load for the given day.

getValue(String)

Returns the value for the given field for the appointment pointed to by the internal iterator.

Declaration

String getValue(String field)

Parameters

Type Name Description
String field The field to get the value for.

Returns

Type Description
String The value for the given field for the appointment pointed to by the internal iterator.

next()

Moves the internal iterator to next appointment in the same day.

Returns false if eof(); otherwise, true.

Declaration

next()

Returns

Type Description
Bool False if eof(); otherwise, true.

setActiveDate(Date)

Sets the internal iterator to the given date.

Declaration

Void SetActiveDate(Date date)

Parameters

Type Name Description
Date date The date to set the internal iterator to.

Returns

Type Description