<html> element:
If a user wishes to add further adjustments to their availability for special occasions or events, they can use the date overrides feature. Date overrides enables users to pick any date that they’re currently available and set specific hours for availability on that day or mark themselves entirely unavailable. Once that day is passed, the date override is automatically deleted.
Below code snippet can be used to render date overrides into the availability settings atom
We offer all kinds of customizations to the availability settings atom via props and customClassNames.
Below is a list of props that can be passed to the availability settings atom.
Along with the props, Availability settings atom accepts custom styles via the customClassNames prop. Below is a list of props that fall under this customClassNames prop.
scheduleClassNames Object Structure
ThescheduleClassNames prop accepts an object with the following structure for granular styling of schedule components:
timePicker Object Structure (nested within scheduleClassNames)
ThetimePicker prop accepts an object with the following structure for granular styling of time picker dropdown components. This applies to the time selection dropdowns (e.g., [ 9:00 ]) that users can click to open a dropdown with available times or click to manually enter a time:
dateOverrideClassNames Object Structure
ThedateOverrideClassNames prop accepts an object with the following structure for granular styling of date override components:
Please ensure all custom classnames are valid Tailwind CSS classnames.
Programmatic Form Validation and Submission
The AvailabilitySettings component supports programmatic form validation and submission through a ref-based API. This allows you to validate availability data and submit forms programmatically without user interaction.Ref Methods
Callbacks
ThehandleFormSubmit method accepts an optional callbacks object with the following properties:
- onSuccess: Called when the form submission is successful. This allows you to execute additional logic after a successful update.
- onError: Called when an error occurs during form submission. The error parameter contains details about what went wrong, allowing you to handle specific error cases or display custom error messages.
validateForm method returns an AvailabilityFormValidationResult object with:
isValid: Boolean indicating if the form passed validationerrors: Object containing any validation errors found
validateForm method will not return any error. The validation focuses on the format and consistency of provided data rather than enforcing required field completion.