Calendar
日付・期間・複数の日付を選ぶ月のグリッド。WAI-ARIA の日付グリッドのキー操作、最小日と最大日、無効な日、Intl による月名に対応します。
Angular: 対応 Vue: 対応 React: 対応 React Native: 対応
使い方
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
<div class="demo-row" style="align-items: flex-start; flex-wrap: wrap">
<sone-calendar [(value)]="date" ariaLabel="Delivery date" />
<sone-calendar mode="range" [(value)]="stay" [weekStartsOn]="1" ariaLabel="Stay" />
</div>インポート
import {
SoneCalendarComponent,
} from "@surface-one/angular/calendar";API リファレンス
SoneCalendarComponentコンポーネント
`<sone-calendar>` — a month grid to pick a date, a range or several dates (spartan/ui and shadcn/ui Calendar). The grid follows the WAI-ARIA date picker pattern: one Tab stop, the arrow keys move a day or a week, Home / End to the week's ends, PageUp / PageDown a month and, with Shift, a year; Enter or Space picks. Dates are ISO strings ("YYYY-MM-DD"); month and weekday names come from `Intl` in `locale`.
| 名前 | 型 | デフォルト |
|---|---|---|
modeWhat a pick does: take one date, close a range, or toggle a date of a list. | SoneCalendarMode | "single" |
value双方向The picked date(s) — `[(value)]`: "YYYY-MM-DD" or `null` (`single`), a list (`multiple`) or `{ start, end }` (`range`). | SoneCalendarValue | null |
month双方向The month shown, "YYYY-MM" — `[(month)]`. Default: the picked date's, else today's. | string | null | null |
minThe earliest and latest date that can be picked ("YYYY-MM-DD"). | string | null | null |
max | string | null | null |
disabledDateRefuses more dates: `(iso) => true` disables that day. | ((iso: string) => boolean) | null | null |
weekStartsOnThe first day of the week: 0 = Sunday (the default) … 6 = Saturday. | SoneWeekday | 0 |
localeA BCP 47 tag for the month and weekday names (default: the app's `LOCALE_ID`). | string | null | null |
todayToday, "YYYY-MM-DD". Default: the browser's date, read after the first render so a prerendered page hydrates without a mismatch. | string | null | null |
showOutsideDaysShows the neighbour months' days that pad the first and last week. | boolean | true |
disabled | boolean | false |
ariaLabelNames the grid; by default the month caption does. | string | null | null |
autofocusDayMarks the grid's Tab stop `data-autofocus` (a popover focuses it on open). | boolean | false |
previousMonthLabel | — | $localize`:Calendar previous month button:Previous month` |
nextMonthLabel | — | $localize`:Calendar next month button:Next month` |
| 名前 | 型 |
|---|---|
dateSelectFires on every pick, with the day picked. | string |