# Date input (UI SDK): Unavailable dates

> `unavailable` takes ISO dates, `{ from, to }` ranges, weekdays or a function, and a date on one is invalid.

Canonical: https://hextaui.com/docs/ui-sdk-date-input/examples/unavailable

Component docs: https://hextaui.com/docs/ui-sdk-date-input

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/ui-sdk-date-input-unavailable.json
```

This adds `components/examples/ui-sdk-date-input/unavailable.tsx` with the Date input component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/ui-sdk-date-input/unavailable.tsx"
"use client"

import * as React from "react"

import { Label } from "@/components/ui/label"
import { DateInput } from "@/components/ui/ui-sdk-date-input"

function isWeekend(date: string) {
  const day = new Date(`${date}T12:00`).getDay()
  return day === 0 || day === 6
}

function UiSdkDateInputUnavailable() {
  const [date, setDate] = React.useState<string | null>("2026-11-02")
  const weekend = date !== null && isWeekend(date)

  return (
    <div className="flex w-full max-w-44 flex-col gap-2">
      <Label id="delivery-date">Delivery date</Label>
      <DateInput
        aria-labelledby="delivery-date"
        aria-describedby="delivery-date-message"
        defaultValue="2026-11-02"
        unavailable={{ weekday: [0, 6] }}
        onValueChange={(value) => setDate(value)}
      />
      <p
        id="delivery-date-message"
        className={
          weekend
            ? "m-0 text-xs text-destructive"
            : "m-0 text-xs text-muted-foreground"
        }
      >
        {weekend
          ? "We don’t deliver on weekends."
          : "We deliver Monday to Friday."}
      </p>
    </div>
  )
}

export { UiSdkDateInputUnavailable }
```

## Props in this example

### DateInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string \| null` | – |  |
| `onValueChange` | `(value: string \| null, details) => void` | – | Runs once every part holds something, and with null when one is emptied. |
| `unavailable` | `DateMatchers` | – | ISO dates, { from, to } ranges, { weekday } or a function. |

## More Date input examples

- [Date and time](https://hextaui.com/docs/ui-sdk-date-input/examples/date-time)
- [Min and max](https://hextaui.com/docs/ui-sdk-date-input/examples/min-max)
- [Locale](https://hextaui.com/docs/ui-sdk-date-input/examples/locale)
- [Form](https://hextaui.com/docs/ui-sdk-date-input/examples/form)
- [Controller](https://hextaui.com/docs/ui-sdk-date-input/examples/controller)
- [Disabled](https://hextaui.com/docs/ui-sdk-date-input/examples/disabled)
- [Read-only](https://hextaui.com/docs/ui-sdk-date-input/examples/read-only)
- [Right to left](https://hextaui.com/docs/ui-sdk-date-input/examples/rtl)
