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
  b8dbd77a_b928_93ae_06ac_34b1e00b57cb["DatePickerTime()"]
  36c5e266_fa08_0402_9820_70783c11a123["date-picker-time.tsx"]
  b8dbd77a_b928_93ae_06ac_34b1e00b57cb -->|defined in| 36c5e266_fa08_0402_9820_70783c11a123
  style b8dbd77a_b928_93ae_06ac_34b1e00b57cb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/date-picker-time.tsx lines 16–63

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
            render={
              <Button
                variant="outline"
                id="date-picker-optional"
                className="w-32 justify-between font-normal"
              />
            }
          >
            {date ? format(date, "PPP") : "Select date"}
            <ChevronDownIcon data-icon="inline-end" />
          </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/base/date-picker-time.tsx.
Where is DatePickerTime() defined?
DatePickerTime() is defined in apps/v4/examples/base/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