Home / Function/ Calendar29() — ui Function Reference

Calendar29() — ui Function Reference

Architecture documentation for the Calendar29() function in calendar-29.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  4fbed871_6fa0_a4d6_c5c9_4a1907210f8e["Calendar29()"]
  c25c3aef_010b_2eef_6b39_d87f79470ab9["calendar-29.tsx"]
  4fbed871_6fa0_a4d6_c5c9_4a1907210f8e -->|defined in| c25c3aef_010b_2eef_6b39_d87f79470ab9
  34ced62d_b68c_e57e_6c54_0b03a985da44["formatDate()"]
  4fbed871_6fa0_a4d6_c5c9_4a1907210f8e -->|calls| 34ced62d_b68c_e57e_6c54_0b03a985da44
  style 4fbed871_6fa0_a4d6_c5c9_4a1907210f8e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/www/__registry__/new-york/blocks/calendar-29.tsx lines 29–96

export default function Calendar29() {
  const [open, setOpen] = React.useState(false)
  const [value, setValue] = React.useState("In 2 days")
  const [date, setDate] = React.useState<Date | undefined>(
    parseDate(value) || undefined
  )
  const [month, setMonth] = React.useState<Date | undefined>(date)

  return (
    <div className="flex flex-col gap-3">
      <Label htmlFor="date" className="px-1">
        Schedule Date
      </Label>
      <div className="relative flex gap-2">
        <Input
          id="date"
          value={value}
          placeholder="Tomorrow or next week"
          className="bg-background pr-10"
          onChange={(e) => {
            setValue(e.target.value)
            const date = parseDate(e.target.value)
            if (date) {
              setDate(date)
              setMonth(date)
            }
          }}
          onKeyDown={(e) => {
            if (e.key === "ArrowDown") {
              e.preventDefault()
              setOpen(true)
            }
          }}
        />
        <Popover open={open} onOpenChange={setOpen}>
          <PopoverTrigger asChild>
            <Button
              id="date-picker"
              variant="ghost"
              className="absolute top-1/2 right-2 size-6 -translate-y-1/2"
            >
              <CalendarIcon className="size-3.5" />
              <span className="sr-only">Select date</span>
            </Button>
          </PopoverTrigger>
          <PopoverContent className="w-auto overflow-hidden p-0" align="end">
            <Calendar
              mode="single"
              selected={date}
              captionLayout="dropdown"
              month={month}
              onMonthChange={setMonth}
              onSelect={(date) => {
                setDate(date)
                setValue(formatDate(date))
                setOpen(false)
              }}
            />
          </PopoverContent>
        </Popover>
      </div>
      <div className="text-muted-foreground px-1 text-sm">
        Your post will be published on{" "}
        <span className="font-medium">{formatDate(date)}</span>.
      </div>
    </div>
  )
}

Subdomains

Calls

Frequently Asked Questions

What does Calendar29() do?
Calendar29() is a function in the ui codebase, defined in deprecated/www/__registry__/new-york/blocks/calendar-29.tsx.
Where is Calendar29() defined?
Calendar29() is defined in deprecated/www/__registry__/new-york/blocks/calendar-29.tsx at line 29.
What does Calendar29() call?
Calendar29() calls 1 function(s): formatDate.

Analyze Your Own Codebase

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

Try Supermodel Free