Fix: Pass captionLayout to Calendar in DatePicker

This commit is contained in:
gpt-engineer-app[bot]
2025-10-11 17:43:09 +00:00
parent f083f8c25d
commit bd0b0a81a1
3 changed files with 19 additions and 11 deletions

View File

@@ -94,10 +94,14 @@ export function FormerNamesEditor({ names, onChange, currentName }: FormerNamesE
<div className="grid grid-cols-1 md:grid-cols-3 gap-3"> <div className="grid grid-cols-1 md:grid-cols-3 gap-3">
<div> <div>
<Label className="text-xs">Date Changed</Label> <Label className="text-xs">Date Changed</Label>
<DatePicker <DatePicker
date={name.date_changed ? new Date(name.date_changed) : undefined} date={name.date_changed ? new Date(name.date_changed) : undefined}
onSelect={(date) => updateName(actualIndex, 'date_changed', date || undefined)} onSelect={(date) => updateName(actualIndex, 'date_changed', date || undefined)}
/> placeholder="Select or type date"
allowTextEntry={true}
fromYear={1800}
toYear={new Date().getFullYear()}
/>
</div> </div>
<div> <div>

View File

@@ -180,13 +180,15 @@ export function ReviewForm({
{/* Visit Date */} {/* Visit Date */}
<div className="space-y-2"> <div className="space-y-2">
<Label>Visit Date</Label> <Label>Visit Date</Label>
<DatePicker <DatePicker
date={watch('visit_date') ? new Date(watch('visit_date')) : undefined} date={watch('visit_date') ? new Date(watch('visit_date')) : undefined}
onSelect={(date) => setValue('visit_date', date ? date.toISOString().split('T')[0] : undefined)} onSelect={(date) => setValue('visit_date', date ? date.toISOString().split('T')[0] : undefined)}
placeholder="When did you visit?" placeholder="When did you visit?"
disableFuture={true} disableFuture={true}
fromYear={1950} fromYear={1950}
/> allowTextEntry={true}
dateFormat="yyyy-MM-dd"
/>
<p className="text-xs text-muted-foreground"> <p className="text-xs text-muted-foreground">
Select the date of your visit to help others understand when this experience occurred. Select the date of your visit to help others understand when this experience occurred.
</p> </p>

View File

@@ -139,6 +139,7 @@ export function DatePicker({
className="p-3 pointer-events-auto" className="p-3 pointer-events-auto"
fromYear={fromYear} fromYear={fromYear}
toYear={toYear} toYear={toYear}
captionLayout="dropdown-buttons"
/> />
</PopoverContent> </PopoverContent>
</Popover> </Popover>
@@ -175,6 +176,7 @@ export function DatePicker({
className="p-3 pointer-events-auto" className="p-3 pointer-events-auto"
fromYear={fromYear} fromYear={fromYear}
toYear={toYear} toYear={toYear}
captionLayout="dropdown-buttons"
/> />
</PopoverContent> </PopoverContent>
</Popover> </Popover>