Home / Function/ DatePickerTime() — ui Function Reference

DatePickerTime() — ui Function Reference

Architecture documentation for the DatePickerTime() function in date-picker-time.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  f86b7cdd_08a2_71d5_023c_cb89e649dc25["DatePickerTime()"]
  78e7d713_3e67_fc16_2769_d2bbca8bdc37["date-picker-time.tsx"]
  f86b7cdd_08a2_71d5_023c_cb89e649dc25 -->|defined in| 78e7d713_3e67_fc16_2769_d2bbca8bdc37
  style f86b7cdd_08a2_71d5_023c_cb89e649dc25 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/date-picker-time.tsx lines 16–61

export function DatePickerTime() {
  const [open, setOpen] = React.useState(false)
  const [date, setDate] = React.useState<Date | undefined>(undefined)

  return (
    <FieldGroup className="mx-auto max-w-xs flex-row">
      <Field>
        <FieldLabel htmlFor="date-picker-optional">Date</FieldLabel>
        <Popover open={open} onOpenChange={setOpen}>
          <PopoverTrigger asChild>
            <Button
              variant="outline"
              id="date-picker-optional"
              className="w-32 justify-between font-normal"
            >
              {date ? format(date, "PPP") : "Select date"}
              <ChevronDownIcon />
            </Button>
          </PopoverTrigger>
          <PopoverContent className="w-auto overflow-hidden p-0" align="start">
            <Calendar
              mode="single"
              selected={date}
              captionLayout="dropdown"
              defaultMonth={date}
              onSelect={(date) => {
                setDate(date)
                setOpen(false)
              }}
            />
          </PopoverContent>
        </Popover>
      </Field>
      <Field className="w-32">
        <FieldLabel htmlFor="time-picker-optional">Time</FieldLabel>
        <Input
          type="time"
          id="time-picker-optional"
          step="1"
          defaultValue="10:30:00"
          className="bg-background appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
        />
      </Field>
    </FieldGroup>
  )
}

Subdomains

Frequently Asked Questions

What does DatePickerTime() do?
DatePickerTime() is a function in the ui codebase, defined in apps/v4/examples/radix/date-picker-time.tsx.
Where is DatePickerTime() defined?
DatePickerTime() is defined in apps/v4/examples/radix/date-picker-time.tsx at line 16.

Analyze Your Own Codebase

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

Try Supermodel Free