@collectivtech/alana-sdk-js / resources/experience / ExperienceAvailabilityBlock
Class: ExperienceAvailabilityBlock
Defined in: src/resources/experience.ts:164
A block of time in which an experience is available. Experience availability blocks are intended to be like opening hours for a business, recurring with each week. Therefore, they consist of a start and end time, plus a set of weekdays.
Constructors
Constructor
new ExperienceAvailabilityBlock(
rawBlock?):ExperienceAvailabilityBlock
Defined in: src/resources/experience.ts:196
Create an availability block from a raw API response. This is needed because the ALANA API uses a format that is optimized for transmission rather than use.
Parameters
rawBlock?
any
A JSON object representing an availability block
Returns
ExperienceAvailabilityBlock
Properties
days
days:
Set<DaysOfWeek>
Defined in: src/resources/experience.ts:187
The days of the week this availability block is valid for. Note that a block may extend to the following day if the end time is earlier than the start time.
end?
optionalend?:GenericTime
Defined in: src/resources/experience.ts:180
The local time that is the end of this block.
Note: If the end time is earlier in the day than the start time, then the availability period will be assumed to continue past midnight into the following day. For example, a start time of { hours: 12, minutes: 0}, representing noon, could be paired with { hours: 2, minutes: 30 }, or 2:30 AM. This is valid, and indicates an experience available from noon on one day to 2:30 AM on the next.
start?
optionalstart?:GenericTime
Defined in: src/resources/experience.ts:168
The local time that is the start of this block.
Methods
toApiFormat()
toApiFormat():
object
Defined in: src/resources/experience.ts:236
Convert this availability block into the format used by the ALANA API.
Returns
object
A JSON object that can be used with the ALANA API
end_hour
end_hour:
number|undefined
end_minute
end_minute:
number|undefined
friday
friday:
boolean
monday
monday:
boolean
saturday
saturday:
boolean
start_hour
start_hour:
number|undefined
start_minute
start_minute:
number|undefined
sunday
sunday:
boolean
thursday
thursday:
boolean
tuesday
tuesday:
boolean
wednesday
wednesday:
boolean