我正在使用最新的material-ui / pickers v4-alpha7。
我希望DateRangePicker在第一次打开时显示上个月和当前月份。
如果今天是5月10日,则默认情况下显示5月-6月,而我需要4月-5月。可能吗?
function BasicDateRangePicker() {
const [selectedDate, handleDateChange] = React.useState<DateRange>([null, null]);
return (
<DateRangePicker
startText="Check-in"
endText="Check-out"
value={selectedDate}
onChange={date => handleDateChange(date)}
renderInput={(startProps, endProps) => (
<>
<TextField {...startProps} />
<DateRangeDelimiter> to </DateRangeDelimiter>
<TextField {...endProps} />
</>
)}
/>
);
}
Br,伊戈尔