formcycle 8.4.0 - JavaScript for forms
    Preparing search index...

    Interface AppointmentPickerApiAction

    Provides functions related to performing actions on an appointment picker, such as selecting a different slot, opening / closing the picker, or loading available slots.

    Available via $.xutil.appointmentPicker.do.

    interface AppointmentPickerApiAction {
        changeDisplay: (picker: any, mode?: ChangeDisplayMode) => void;
        changeLock: (picker: any, mode: ChangeLockMode) => void;
        changeMonthYear: (picker: any, monthYear: LocalMonthYear) => void;
        changeMonthYearToNow: (picker: any) => void;
        changeOptions: (
            picker: any,
            options: Partial<AppointmentPickerOptions>,
        ) => void;
        clearDisabledDates: (picker: any) => void;
        disableDateRanges: (
            picker: any,
            ...ranges: readonly LocalDateRange[],
        ) => void;
        disableDates: (picker: any, ...dates: readonly LocalDate[]) => void;
        disableDatesAfter: (picker: any, maxDate: LocalDate) => void;
        disableDatesBefore: (picker: any, minDate: LocalDate) => void;
        enableDateRanges: (
            picker: any,
            ...ranges: readonly LocalDateRange[],
        ) => void;
        enableDates: (picker: any, ...dates: readonly LocalDate[]) => void;
        enableDatesAfter: (picker: any, maxDate: LocalDate) => void;
        enableDatesBefore: (picker: any, minDate: LocalDate) => void;
        loadAvailableSlots: (
            picker: any,
            monthYear: LocalMonthYear,
        ) => Promise<AppointmentMonthSlotData>;
        moveMonthYearBy: (
            picker: any,
            monthYearDuration: Partial<LocalMonthYearDuration>,
        ) => void;
        selectDate: (
            picker: any,
            date: LocalDate,
            options?: AppointmentPickerSetDateOptions,
        ) => void;
        selectSlot: (
            picker: any,
            slot: AppointmentSlot,
            options?: AppointmentPickerSetSlotOptions,
        ) => void;
        setPersistedAppointment: (
            picker: any,
            appointment: AppointmentPickerPersistedAppointment,
        ) => void;
    }
    Index

    Properties

    changeDisplay: (picker: any, mode?: ChangeDisplayMode) => void

    Closes or opens the appointment picker, for all appointment pickers from the given reference.

    Closing the picker requires that it is closable. Otherwise, no action is performed.

    Type declaration

      • (picker: any, mode?: ChangeDisplayMode): void
      • Parameters

        • picker: any

          A reference to the appointment pickers that should be opened or closed.

        • Optionalmode: ChangeDisplayMode

          How to change the display. open to open it (if not already opened), close to close it (when not already closed), and toggle (or undefined) to open it when closed and close it when opened.

        Returns void

    changeLock: (picker: any, mode: ChangeLockMode) => void

    Changes the lock state of the appointment picker, for all pickers from the given reference.

    When the picker is enabled, it can be edited by the user. When it is disabled or read-only, it cannot be edited by the user anymore, but its value can still be changed via scripting.

    Appointment pickers that are disabled or read-only are always closed and cannot be opened.

    Type declaration

      • (picker: any, mode: ChangeLockMode): void
      • Parameters

        • picker: any

          A reference to the appointment picker for which to check whether it is locked.

        • mode: ChangeLockMode

        Returns void

    changeMonthYear: (picker: any, monthYear: LocalMonthYear) => void

    Shows a particular month in a given year and shows all days for the month, for all appointment pickers from the given reference.

    Type declaration

      • (picker: any, monthYear: LocalMonthYear): void
      • Parameters

        • picker: any

          A reference to the appointment picker for which to set the calendar's month and year.

        • monthYear: LocalMonthYear

          A month and year to show in the calendar.

        Returns void

    changeMonthYearToNow: (picker: any) => void

    Selects the current month of the current year and shows all days for the month, for all appointment pickers from the given reference.

    Type declaration

      • (picker: any): void
      • Parameters

        • picker: any

          A reference to the appointment picker for which to set the calendar's month and year.

        Returns void

    changeOptions: (picker: any, options: Partial<AppointmentPickerOptions>) => void

    Sets the options all appointment picker from the given reference,

    Type declaration

    clearDisabledDates: (picker: any) => void

    Removes all disabled dates, so that no more dates are disabled, for all appointment pickers from the given reference.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any): void
      • Parameters

        • picker: any

          A reference to the appointment pickers for which to clear the disabled dates.

        Returns void

    disableDateRanges: (picker: any, ...ranges: readonly LocalDateRange[]) => void

    Adds a list of date ranges to the list of disabled date ranges, for all appointment pickers from the given reference.

    These dates are additive. You can add multiple ranges of disabled dates.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any, ...ranges: readonly LocalDateRange[]): void
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        • ...ranges: readonly LocalDateRange[]

          Ranges of dates to disable.

        Returns void

    disableDates: (picker: any, ...dates: readonly LocalDate[]) => void

    Disables the given dates, for all appointment pickers from the given reference.

    These dates are additive. You can add multiple disabled dates.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any, ...dates: readonly LocalDate[]): void
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        • ...dates: readonly LocalDate[]

          List of dates to disable.

        Returns void

    disableDatesAfter: (picker: any, maxDate: LocalDate) => void

    Disables all dates after the given date, for al first appointment pickers from the given reference.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any, maxDate: LocalDate): void
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        • maxDate: LocalDate

          Maximum allowed date, all dates after this date are disabled.

        Returns void

    disableDatesBefore: (picker: any, minDate: LocalDate) => void

    Disables all dates before the given date, for al first appointment pickers from the given reference.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any, minDate: LocalDate): void
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        • minDate: LocalDate

          Minimum allowed date, all dates before this date are disabled.

        Returns void

    enableDateRanges: (picker: any, ...ranges: readonly LocalDateRange[]) => void

    Removes a list of date ranges from the list of disabled date ranges, for all appointment pickers from the given reference.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any, ...ranges: readonly LocalDateRange[]): void
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        • ...ranges: readonly LocalDateRange[]

          Ranges of dates to enable.

        Returns void

    enableDates: (picker: any, ...dates: readonly LocalDate[]) => void

    Enables the given dates, for all appointment pickers from the given reference.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any, ...dates: readonly LocalDate[]): void
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        • ...dates: readonly LocalDate[]

          List of dates to enable.

        Returns void

    enableDatesAfter: (picker: any, maxDate: LocalDate) => void

    Enables all dates after the given date, for al first appointment pickers from the given reference.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any, maxDate: LocalDate): void
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        • maxDate: LocalDate

          Maximum allowed date, all dates after this date are enabled.

        Returns void

    enableDatesBefore: (picker: any, minDate: LocalDate) => void

    Enables all dates before the given date, for al first appointment pickers from the given reference.

    Disabled dates cannot be selected by the user. Note that dates without available slots are usually also displayed as disabled, but are not included in the result of this function.

    Type declaration

      • (picker: any, minDate: LocalDate): void
      • Parameters

        • picker: any

          A reference to the appointment picker to process.

        • minDate: LocalDate

          Minimum allowed date, all dates before this date are enabled.

        Returns void

    loadAvailableSlots: (
        picker: any,
        monthYear: LocalMonthYear,
    ) => Promise<AppointmentMonthSlotData>

    Loads the available slots of a given month year, for the first appointment picker from the given reference.

    Type declaration

    moveMonthYearBy: (
        picker: any,
        monthYearDuration: Partial<LocalMonthYearDuration>,
    ) => void

    Changes the month and year of the calendar by the given amount, for all appointment pickers from the given reference.

    Type declaration

      • (picker: any, monthYearDuration: Partial<LocalMonthYearDuration>): void
      • Parameters

        • picker: any

          A reference to the appointment picker for which to set the calendar's month and year.

        • monthYearDuration: Partial<LocalMonthYearDuration>

          The month and year to select, relative to the currently selected month and year. When missing, the month and year default to 0. Can be negative.

        Returns void

    selectDate: (
        picker: any,
        date: LocalDate,
        options?: AppointmentPickerSetDateOptions,
    ) => void

    Selects a particular day and shows the available slots of that day, for all appointment pickers from the given reference.

    Type declaration

    selectSlot: (
        picker: any,
        slot: AppointmentSlot,
        options?: AppointmentPickerSetSlotOptions,
    ) => void

    Changes the currently selected slot to the given slot or clears the selected slot, for all appointment pickers from the given reference.

    Type declaration

    setPersistedAppointment: (
        picker: any,
        appointment: AppointmentPickerPersistedAppointment,
    ) => void

    Sets the persisted appointment, for all appointment pickers from the given reference.

    Each picker may be associated with an appointment that was booked on the server, usually previously when the form was first submitted. Normally selected slots that do not correspond to an available slot are treated as invalid. When a selected slot correspond to the persisted slot, that selection is always allowed. that corresponds to this persisted appointment

    Type declaration