Skip to content

DatePicker with Popover [enabling shadcn styling for months/years dropdown menu] #1553

Answered by auzeonfung
aktienautobahn asked this question in Q&A
Discussion options

You must be logged in to vote

Need to wait for someone with access to pass pr before merging it into the main stream, it takes time, they are all busy after all...
For what it's worth, the easiest way to do this is to copy and paste.

I hope this helps.

Usage

"use client"

import * as React from "react"

import { Calendar } from "@/registry/new-york/ui/calendar"

export default function CalendarDropdownButton() {
  const [date, setDate] = React.useState<Date | undefined>(new Date())

  return (
    <Calendar
      initialFocus
      mode="single"
      captionLayout="dropdown-buttons" //Also: dropdown | buttons
      fromYear={2022} 
      toYear={2023}
      selected={date}
      onSelect={setDate}
      // numberOfMo…

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
5 replies
@aktienautobahn
Comment options

@auzeonfung
Comment options

Answer selected by aktienautobahn
@aktienautobahn
Comment options

@aktienautobahn
Comment options

@larssbr
Comment options

Comment options

You must be logged in to vote
4 replies
@ravics09
Comment options

@sersavan
Comment options

@sersavan
Comment options

@ravics09
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants