File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/ui/src/components/Datepicker/Views Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,10 @@ export const DatepickerViewsMonth: FC<DatepickerViewsMonthsProps> = ({ theme: cu
3737 < div className = { theme . items . base } >
3838 { [ ...Array ( 12 ) ] . map ( ( _month , index ) => {
3939 const newDate = new Date ( ) ;
40- // setting day to 1 to avoid overflow issues
41- newDate . setMonth ( index , 1 ) ;
40+ // Set newDate to the last day of the month based on the provided index.
41+ // This is necessary for enabling the month button when minDate is set (e.g., minDate = 1/23/2025).
42+ newDate . setMonth ( index + 1 , 1 ) ;
43+ newDate . setDate ( newDate . getDate ( ) - 1 ) ;
4244 newDate . setFullYear ( viewDate . getFullYear ( ) ) ;
4345 const month = getFormattedDate ( language , newDate , { month : "short" } ) ;
4446
You can’t perform that action at this time.
0 commit comments