# Calendar Standard 4 - Calendar with Date and Time

> Calendar with date and time input.

A shadcn/ui block from the [@shadcnblocks](https://shadcnblocks.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnblocks/calendar-calendar-standard-4).

- Page, with a live preview: https://shadcn.exchange/r/shadcnblocks/calendar-calendar-standard-4
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnblocks/calendar-calendar-standard-4-light-f8bb06517b0cb6c3.png
- Registry item: https://shadcnblocks.com/r/calendar-calendar-standard-4.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnblocks.com/r/calendar-calendar-standard-4.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `calendar`, `input`, `label`

## Files

### `example/calendar/calendar-standard-4.tsx`

```tsx
"use client";

import { useState } from "react";

import { Calendar } from "@/components/ui/calendar";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";

export const title = "Calendar with Date and Time";

const Example = () => {
  const [date, setDate] = useState<Date | undefined>(new Date());
  const [time, setTime] = useState<string>("12:00");

  const handleTimeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    setTime(e.target.value);
    if (date) {
      const [hours, minutes] = e.target.value.split(":");
      const newDate = new Date(date);
      newDate.setHours(
        Number.parseInt(hours, 10),
        Number.parseInt(minutes, 10),
      );
      setDate(newDate);
    }
  };

  return (
    <div className="divide-y overflow-hidden rounded-md border bg-background">
      <Calendar mode="single" onSelect={setDate} selected={date} />
      <div className="space-y-2 p-4">
        <Label htmlFor="time">Time</Label>
        <Input
          className="w-full"
          id="time"
          onChange={handleTimeChange}
          type="time"
          value={time}
        />
      </div>
    </div>
  );
};

export default Example;
```
