TimeSlotsResult - gomeddo/js-sdk GitHub Wiki
Object containing the results of a TimeSlotsRequest, including methods to get the all or individual timeslots.
Example
const timeslotsResult = gm.buildTimeSlotsRequest(startDateTime, endDateTime)
.withField("B25__Resource__c", "a0nWy0000000KWbIAM")
.withField("B25__Resource__c", [resourceObj1, resourceObj2])
.withDuration(120)
.withInterval(30)
.getResults()
Instance methods
getTimeSlots
Syntax
getTimeSlots()
Return value: A list of ReservationTimeSlot objects.
Description
Gets a list of all the timeslots in the result.
numberOfTimeSlots
Syntax
numberOfTimeSlots()
Return value: The number of timeslots in the result.
Description
Gets the number of timeslots in the result.
getUpcomingTimeSlot
Syntax
getUpcomingTimeSlot(date)
Parameters:
date
A javascriptdate
object
Return value:
A single ReservationTimeSlot object or null
Description
Get the upcoming timeslot to a given time.
getUpcomingTimeSlots
Syntax
getUpcomingTimeSlots(date, count)
Parameters:
date
A javascriptdate
objectcount
The number of timeslots to return, ifundefined
, will return all fromdate
onwards.
Return value: A list of ReservationTimeSlot objects or an empty list.
Description
Get the upcoming timeslot to a given time.
getTimeSlotAtTime
Syntax
getTimeSlotAtTime(date)
Parameters:
date
A javascriptdate
object
Return value:
A single ReservationTimeSlot object or null
Description
Get a timeslot with a specific starting time.
getTimeSlotsAtTime
Syntax
getTimeSlotsAtTime(date)
Parameters:
date
A javascriptdate
object
Return value: A list of ReservationTimeSlot objects or an empty list.
Description
Get timeslots with a specific starting time.
getTimeSlotsBetween
Syntax
getTimeSlotsBetween(startRange, endRange)
Parameters:
startRange
A javascriptdate
objectendRange
A javascriptdate
object
Return value: A list of ReservationTimeSlot objects or an empty list.
Description
Get timeslots within a time range (from the existing results).