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

    Interface AppointmentPickerApiSnapshot

    (advanced) Provides functions related to snapshots. A snapshot is a frozen view of an appointment picker's state at a particular moment in time. After taking a snapshot, the picker's state can be restored to that snapshot at a later point in time.

    Available via $.xutil.appointmentPicker.snapshot.

    interface AppointmentPickerApiSnapshot {
        discard: (snapshotToken: string) => void;
        restore: (
            picker: AppointmentPickerInstanceReference,
            snapshotToken: string,
            options?: AppointmentPickerRestoreSnapshotOptions,
        ) => void;
        setPersistedAppointment: (
            snapshotToken: string,
            appointment: AppointmentPickerPersistedAppointment,
        ) => string;
        setSlot: (
            snapshotToken: string,
            slot: AppointmentSlot,
            options?: AppointmentPickerSetSlotOptions,
        ) => string;
        take: (picker: AppointmentPickerInstanceReference) => string;
    }
    Index

    Properties

    discard: (snapshotToken: string) => void

    Advanced usage Do not use this method if you do not understand it.

    Discards a snapshot that was created by a call to take. Afterward, the snapshot cannot be restored anymore.

    restore: (
        picker: AppointmentPickerInstanceReference,
        snapshotToken: string,
        options?: AppointmentPickerRestoreSnapshotOptions,
    ) => void

    Advanced usage Do not use this method if you do not understand it.

    Restores the state of all appointment pickers to the given state, identified by its snapshot token. This must be a token as returned by take.

    Type declaration

    setPersistedAppointment: (
        snapshotToken: string,
        appointment: AppointmentPickerPersistedAppointment,
    ) => string

    Derives a new snapshot by setting the persisted appointment.

    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

    The returned snapshot token may be identical to the given snapshot token if the request did not result in any actual modifications.

    If the given snapshot token refers to a non-existing snapshot, the given token is returned as-is.

    Type declaration

      • (
            snapshotToken: string,
            appointment: AppointmentPickerPersistedAppointment,
        ): string
      • Parameters

        • snapshotToken: string

          A token of an existing snapshot from which to derive a new snapshot.

        • appointment: AppointmentPickerPersistedAppointment

          The new persisted appointment to set, undefined to clear it.

        Returns string

        A snapshot token identifying the new snapshot.

    take

    setSlot: (
        snapshotToken: string,
        slot: AppointmentSlot,
        options?: AppointmentPickerSetSlotOptions,
    ) => string

    Advanced usage Do not use this method if you do not understand it.

    Derives a new snapshot from an existing snapshot by changing the selected slot to the new given slot. The provided snapshot token must be one of the tokens as created by take.

    The returned snapshot token may be identical to the given snapshot token if the request did not result in any actual modifications.

    If the given snapshot token refers to a non-existing snapshot, the given token is returned as-is.

    Type declaration

    take

    take: (picker: AppointmentPickerInstanceReference) => string

    Advanced usage Do not use this method if you do not understand it.

    Creates a snapshot of the first appointment picker from the given reference and returns a token that can then later be used with restore to restore the appointment picker to the exact same state.

    The returned token is valid only for the duration of the global window scope.

    Type declaration