diff --git a/packages/ui/src/components/DateRangePicker/DateRangePicker.stories.tsx b/packages/ui/src/components/DateRangePicker/DateRangePicker.stories.tsx index 3a596c2b91..ed3696ae83 100644 --- a/packages/ui/src/components/DateRangePicker/DateRangePicker.stories.tsx +++ b/packages/ui/src/components/DateRangePicker/DateRangePicker.stories.tsx @@ -16,8 +16,13 @@ import preview from '../../../../../.storybook/preview'; import { DateRangePicker } from './DateRangePicker'; -import { parseDate, today, getLocalTimeZone } from '@internationalized/date'; -import { Form } from 'react-aria-components'; +import { + parseDate, + today, + getLocalTimeZone, + isWeekend, +} from '@internationalized/date'; +import { useLocale, Form } from 'react-aria-components'; import { Button } from '../Button'; const meta = preview.meta({ @@ -128,3 +133,23 @@ export const WithMinMaxValue = meta.story({ maxValue: today(getLocalTimeZone()).add({ days: 30 }), }, }); + +/** + * Weekends are marked unavailable. Because `allowsNonContiguousRanges` is not + * set (defaults to false), the picker prevents the user from selecting any + * range that spans across an unavailable date — the selection snaps to avoid + * crossing a weekend. + */ +export const WithUnavailableDates = meta.story({ + render: args => { + const { locale } = useLocale(); + return ( + isWeekend(date, locale)} + /> + ); + }, +});