Home / File/ analytics-date-picker.tsx — ui Source File

analytics-date-picker.tsx — ui Source File

Architecture documentation for analytics-date-picker.tsx, a tsx file in the ui codebase. 8 imports, 0 dependents.

File tsx DocumentationAtlas Changelog 8 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  b322b706_f3c3_4eef_b0b3_048c74d65060["analytics-date-picker.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  b322b706_f3c3_4eef_b0b3_048c74d65060 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  f9e8c1ea_9de4_3e04_ca27_b15cada2e81e["date-fns"]
  b322b706_f3c3_4eef_b0b3_048c74d65060 --> f9e8c1ea_9de4_3e04_ca27_b15cada2e81e
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  b322b706_f3c3_4eef_b0b3_048c74d65060 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  bfc8708c_7488_3983_8998_32b793781735["react-day-picker"]
  b322b706_f3c3_4eef_b0b3_048c74d65060 --> bfc8708c_7488_3983_8998_32b793781735
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  b322b706_f3c3_4eef_b0b3_048c74d65060 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  57e86e45_ac6e_7278_be08_9092724e8401["button"]
  b322b706_f3c3_4eef_b0b3_048c74d65060 --> 57e86e45_ac6e_7278_be08_9092724e8401
  7bfe56e6_25f1_1b2f_588d_f14238c3c071["calendar"]
  b322b706_f3c3_4eef_b0b3_048c74d65060 --> 7bfe56e6_25f1_1b2f_588d_f14238c3c071
  64a3481c_a85b_fe79_409a_cb7f3f4bb871["popover"]
  b322b706_f3c3_4eef_b0b3_048c74d65060 --> 64a3481c_a85b_fe79_409a_cb7f3f4bb871
  style b322b706_f3c3_4eef_b0b3_048c74d65060 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { addDays, format } from "date-fns"
import { CalendarIcon } from "lucide-react"
import { type DateRange } from "react-day-picker"

import { cn } from "@/lib/utils"
import { Button } from "@/registry/new-york-v4/ui/button"
import { Calendar } from "@/registry/new-york-v4/ui/calendar"
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/registry/new-york-v4/ui/popover"

export function AnalyticsDatePicker() {
  const [date, setDate] = React.useState<DateRange | undefined>({
    from: new Date(new Date().getFullYear(), 0, 20),
    to: addDays(new Date(new Date().getFullYear(), 0, 20), 20),
  })

  return (
    <Popover>
      <PopoverTrigger asChild>
        <Button
          id="date"
          variant="outline"
          className={cn(
            "w-fit justify-start px-2 font-normal",
            !date && "text-muted-foreground"
          )}
        >
          <CalendarIcon className="text-muted-foreground" />
          {date?.from ? (
            date.to ? (
              <>
                {format(date.from, "LLL dd, y")} -{" "}
                {format(date.to, "LLL dd, y")}
              </>
            ) : (
              format(date.from, "LLL dd, y")
            )
          ) : (
            <span>Pick a date</span>
          )}
        </Button>
      </PopoverTrigger>
      <PopoverContent className="w-auto p-0" align="end">
        <Calendar
          initialFocus
          mode="range"
          defaultMonth={date?.from}
          selected={date}
          onSelect={setDate}
          numberOfMonths={2}
        />
      </PopoverContent>
    </Popover>
  )
}

Subdomains

Dependencies

  • button
  • calendar
  • date-fns
  • lucide-react
  • popover
  • react
  • react-day-picker
  • utils

Frequently Asked Questions

What does analytics-date-picker.tsx do?
analytics-date-picker.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, Changelog subdomain.
What functions are defined in analytics-date-picker.tsx?
analytics-date-picker.tsx defines 1 function(s): AnalyticsDatePicker.
What does analytics-date-picker.tsx depend on?
analytics-date-picker.tsx imports 8 module(s): button, calendar, date-fns, lucide-react, popover, react, react-day-picker, utils.
Where is analytics-date-picker.tsx in the architecture?
analytics-date-picker.tsx is located at apps/v4/app/(examples)/dashboard-03/components/analytics-date-picker.tsx (domain: DocumentationAtlas, subdomain: Changelog, directory: apps/v4/app/(examples)/dashboard-03/components).

Analyze Your Own Codebase

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

Try Supermodel Free