import { DaysOfTheWeek } from "@servicetitan/anvil2";
function ExampleComponent() {
const [selectedDays, setSelectedDays] = useState([]);
return (
<DaysOfTheWeek
selectedDays={selectedDays}
onChange={setSelectedDays}
firstDay={7}
disabled={false}
required={false}
/>
); }
DaysOfTheWeek Props
Description text or element to display below the component.
disabled
boolean | number[]
default:"false"
Whether the component is disabled. Can be a boolean to disable all days, or an
array of day numbers (1-7) to disable specific days.
errorAriaLive
"polite" | "assertive" | "off"
default:"assertive"
ARIA live setting for the error message.
Error message to display when there is an error.
The first day of the week (1-7, where 1 is Monday and 7 is Sunday).
Hint text or element to display above the component.
Additional props to pass to the Label component.
Additional info to display in a tooltip next to the label.
onChange
(selectedDays: number[]) => void
Callback fired when the selection changes.
Whether the field is required.
The selected days (1-7, where 1 is Monday and 7 is Sunday).