Home / Function/ CalendarWithTime() — ui Function Reference

CalendarWithTime() — ui Function Reference

Architecture documentation for the CalendarWithTime() function in calendar-time.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  9e060331_4207_ce79_0c76_b017ed80f06a["CalendarWithTime()"]
  55f8ccc8_0a6f_1601_7df8_39cbe0371107["calendar-time.tsx"]
  9e060331_4207_ce79_0c76_b017ed80f06a -->|defined in| 55f8ccc8_0a6f_1601_7df8_39cbe0371107
  style 9e060331_4207_ce79_0c76_b017ed80f06a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/calendar-time.tsx lines 14–65

export function CalendarWithTime() {
  const [date, setDate] = React.useState<Date | undefined>(
    new Date(new Date().getFullYear(), new Date().getMonth(), 12)
  )

  return (
    <Card size="sm" className="mx-auto w-fit">
      <CardContent>
        <Calendar
          mode="single"
          selected={date}
          onSelect={setDate}
          className="p-0"
        />
      </CardContent>
      <CardFooter className="bg-card border-t">
        <FieldGroup>
          <Field>
            <FieldLabel htmlFor="time-from">Start Time</FieldLabel>
            <InputGroup>
              <InputGroupInput
                id="time-from"
                type="time"
                step="1"
                defaultValue="10:30:00"
                className="appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
              />
              <InputGroupAddon>
                <Clock2Icon className="text-muted-foreground" />
              </InputGroupAddon>
            </InputGroup>
          </Field>
          <Field>
            <FieldLabel htmlFor="time-to">End Time</FieldLabel>
            <InputGroup>
              <InputGroupInput
                id="time-to"
                type="time"
                step="1"
                defaultValue="12:30:00"
                className="appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
              />
              <InputGroupAddon>
                <Clock2Icon className="text-muted-foreground" />
              </InputGroupAddon>
            </InputGroup>
          </Field>
        </FieldGroup>
      </CardFooter>
    </Card>
  )
}

Subdomains

Frequently Asked Questions

What does CalendarWithTime() do?
CalendarWithTime() is a function in the ui codebase, defined in apps/v4/examples/radix/calendar-time.tsx.
Where is CalendarWithTime() defined?
CalendarWithTime() is defined in apps/v4/examples/radix/calendar-time.tsx at line 14.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free