Can generate a series of time slots based on certain settings such as slot duration and interval. |
DescriptionGenerates a series of time slots based on the request context. Signature
Parameters
Contains the settings for the series to be generated. Return Type
Contains a |
DescriptionContains the settings for the series to be generated. Properties
The start time of the series to be generated.
The end time of the series to be generated.
The duration of each time slot, in minutes.
Amount of minutes between the start times of each slot. Allows you to have overlap if the interval is lower than the duration. For example, a duration of 60 with an interval of 15 would result in time slots from |
DescriptionContains the resulting time slots. Properties
The resulting time slots. Each time slot has a |
This example shows how you can use the class in your own code.
B25.TimeSlotGenerator.Context context = new B25.TimeSlotGenerator.Context(); context.startOfRange = System.now(); context.endOfRange = System.now().addDays(7); context.duration = 60; context.interval = 15; // call the method and do something with the result B25.TimeSlotGenerator.Result result = B25.TimeSlotGenerator.getTimeSlots(context); for (B25.TimeSlot timeSlot : result.timeSlots) { System.debug('time slot from ' + timeSlot.startDatetime + ' until ' + timeSlot.endDatetime); } |