feat: Implement year grid navigation

This commit is contained in:
gpt-engineer-app[bot]
2025-10-11 17:50:46 +00:00
parent bd0b0a81a1
commit c59ab9523f
4 changed files with 269 additions and 5 deletions

View File

@@ -24,6 +24,7 @@ export interface DatePickerProps {
toYear?: number;
allowTextEntry?: boolean;
dateFormat?: string;
enableYearGrid?: boolean;
}
export function DatePicker({
@@ -38,6 +39,7 @@ export function DatePicker({
toYear,
allowTextEntry = false,
dateFormat = "yyyy-MM-dd",
enableYearGrid = false,
}: DatePickerProps) {
const [open, setOpen] = React.useState(false);
const [textInput, setTextInput] = React.useState("");
@@ -139,7 +141,7 @@ export function DatePicker({
className="p-3 pointer-events-auto"
fromYear={fromYear}
toYear={toYear}
captionLayout="dropdown-buttons"
enableYearGrid={enableYearGrid}
/>
</PopoverContent>
</Popover>
@@ -176,7 +178,7 @@ export function DatePicker({
className="p-3 pointer-events-auto"
fromYear={fromYear}
toYear={toYear}
captionLayout="dropdown-buttons"
enableYearGrid={enableYearGrid}
/>
</PopoverContent>
</Popover>