Home / Function/ CalendarCustomDays() — ui Function Reference

CalendarCustomDays() — ui Function Reference

Architecture documentation for the CalendarCustomDays() function in calendar-custom-days.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  72ada090_7bda_bf2b_b0f7_1a0fe94ef044["CalendarCustomDays()"]
  a5d39393_e83d_86da_a192_fdaec5b07831["calendar-custom-days.tsx"]
  72ada090_7bda_bf2b_b0f7_1a0fe94ef044 -->|defined in| a5d39393_e83d_86da_a192_fdaec5b07831
  style 72ada090_7bda_bf2b_b0f7_1a0fe94ef044 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/calendar-custom-days.tsx lines 9–50

export function CalendarCustomDays() {
  const [range, setRange] = React.useState<DateRange | undefined>({
    from: new Date(new Date().getFullYear(), 11, 8),
    to: addDays(new Date(new Date().getFullYear(), 11, 8), 10),
  })

  return (
    <Card className="mx-auto w-fit p-0">
      <CardContent className="p-0">
        <Calendar
          mode="range"
          defaultMonth={range?.from}
          selected={range}
          onSelect={setRange}
          numberOfMonths={1}
          captionLayout="dropdown"
          className="[--cell-size:--spacing(10)] md:[--cell-size:--spacing(12)]"
          formatters={{
            formatMonthDropdown: (date) => {
              return date.toLocaleString("default", { month: "long" })
            },
          }}
          components={{
            DayButton: ({ children, modifiers, day, ...props }) => {
              const isWeekend =
                day.date.getDay() === 0 || day.date.getDay() === 6

              return (
                <CalendarDayButton day={day} modifiers={modifiers} {...props}>
                  {children}
                  {!modifiers.outside && (
                    <span>{isWeekend ? "$120" : "$100"}</span>
                  )}
                </CalendarDayButton>
              )
            },
          }}
        />
      </CardContent>
    </Card>
  )
}

Subdomains

Frequently Asked Questions

What does CalendarCustomDays() do?
CalendarCustomDays() is a function in the ui codebase, defined in apps/v4/examples/base/calendar-custom-days.tsx.
Where is CalendarCustomDays() defined?
CalendarCustomDays() is defined in apps/v4/examples/base/calendar-custom-days.tsx at line 9.

Analyze Your Own Codebase

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

Try Supermodel Free