To arrange years in reverse order within the material-ui Date Picker's calendar UI, you can pass a start year and end year to the DatePicker
component and set the shouldDisableYear
prop function to return false for all the years within the range. Here's an example:
const startYear = 1950;
const endYear = 2021;
function shouldDisableYear(year) {
return year < startYear || year > endYear;
}
<DatePicker
label="Pick a date"
views={['year', 'month', 'date']}
shouldDisableYear={shouldDisableYear}
minDate={new Date(startYear, 0, 1)}
maxDate={new Date(endYear, 11, 31)}
/>
This will enable only the years within the range and display them in reverse order within the calendar UI.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-11-23 11:00:00 +0000
Seen: 14 times
Last updated: Mar 31 '22
What does "Read timed out" mean in relation to a Batch Request in the Google Calendar API?
Is it possible to set a morning alarm using Expo calendar?
How can an event table be created utilizing FSCalendar?
How can I transform a standard date to a Jalali date in ClickHouse?
What is the process for transforming a date into the desired format using the dayjs module?
Can you assist me with creating a calendar table in POWER BI?