The calendar view can be customized with a couple of different parameters:
- Month or week calendar - switch between
monthandweekthrough thecalendarTypeoption and set the number of months or weeks through thepagesandcalendarSizeoptions - Set a month change direction - specify
'horizontal'or'vertical'in thecalendarScrolloption - Show week numbers - set the
showWeekNumbersto true and show a week counter starting from the first week of every year - Hide the outer days of a month - set the
showOuterDaysto false in case you don't want to see days from previous and next months
Demo
Configure month or week view
Month view with
months
Week view with
weeks
Show annual week numbers
Week counter is visible
Set a scrolling direction
Show days of outer months
Outer days are visible
<Datepicker
select="range"
calendarType="month "
pages={1 }
calendarSize={1 }
showWeekNumbers={false }
calendarScroll="horizontal "
showOuterDays={true }
/>
JSXTSX
import { Datepicker, setOptions } from '@mobiscroll/react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
function App() {
return (
<div>
<Datepicker select="range" display="inline" calendarType="month" pages={2} showWeekNumbers={true} showOuterDays={true} />
<Datepicker select="range" display="inline" calendarType="week" calendarSize={2} showWeekNumbers={true} calendarScroll="vertical" />
</div>
);
}
export default App;
import { Datepicker, setOptions } from '@mobiscroll/react';
import { FC } from 'react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
const App: FC = () => (
<div>
<Datepicker
controls={['calendar']}
select="range"
display="inline"
calendarType="month"
pages={2}
showWeekNumbers={true}
showOuterDays={true}
/>
<Datepicker
controls={['calendar']}
select="range"
display="inline"
calendarType="week"
calendarSize={2}
showWeekNumbers={true}
calendarScroll="vertical"
/>
</div>
);
export default App;