Documentation Index
Fetch the complete documentation index at: https://anvil.servicetitan.com/llms.txt
Use this file to discover all available pages before exploring further.
- Implementation
- Calendar Props
Live Component Playground
Common Examples
Date Format
To follow the international standard, the Anvil2Calendar component uses ISO 8601 for date-time format. ISO date format strings should always be used when passing a date-time value to a Calendar. The same format is also returned by the onSelection callback.Example with new Date()
Controlling calendar state
Uncontrolled calendars
By default, calendars handle their own state. Use thedefaultValue prop to set the initial value of an uncontrolled calendar.Controlled calendars
Use thevalue prop to manually control the state of a calendar.Selecting a date range
Calendar can also be used to select range of dates usingrange prop.Calendar focus
By default, the month of selected date or today is shown.Overriding calendar focus
In the example below,2024-07-07 is the selected date but June is showing on initial render because of focusedDate="2024-06-06".Calendar Timezone
By default, local browser timezone is used. To override local system timezone,defaultTimezone can be used.Scoping calendar dates
There are two different ways to limit the scope of selectable dates within a calendar.Min and Max
TheminDate and maxDate props can be used to scope the date range selection.Unavailable dates
You can also pass an array of dates to theunavailable.dates prop to disable selecting specific dates.