React Weekly Day Picker
This react component provides weekly view and day picker option like calendly.
This component makes use of moment.js.
Installation
To install this Component, run yarn add react-weekly-day-picker
or npm install react-weekly-day-picker
.
Usage
To use the component, In your react application just do
<ReactWeeklyDayPicker />
Props
You can also provide additional configuration like
<ReactWeeklyDayPicker
daysCount={7}
classNames={}
startDay={new Date()}
selectedDays={['22 June 2017', new Date()]}
multipleDaySelect={true}
selectDay={function(day){}}
unselectDay={function(day){}}
onPrevClick={function(startDay, selectedDays){}}
onNextClick={function(startDay, selectedDays){}}
unselectable={false}
format={'YYYY-MM-DD'}
firstLineFormat={'ddd'}
secondLineFormat={'MMM D'}
firstLineMobileFormat={'dddd'}
secondLineMobileFormat={'MMMM D, Y'}
unavailables={{
dates:['22 July 2017'],
relative:[0,1],
weekly: [0]
}}
mobilView={window.innerWidth < 1024}
beforeToday={false}
hiddens={{
dates: ['22 July 2017'],
relative: [2],
weekly: [1]
}}
todayText={"today"}
unavailableText={"Unavailable"}
/>
Responsiveness and Mobil View
When mobilView props is true, mobilView enables:
Styling and Css classes
classNames prop overrides existed css classes
render() {
const classNames = {
container : '',
prevWeekArrow: '',
nextWeekArrow: '',
dayBox: '',
dayCircleContainer: '',
dayCicle: '',
dayCircleTodayText: '',
dayCircleUnavailable: '',
dayCircleUnavailableText: '',
dayCicleSelected: '',
}
return (
<ReactWeeklyDayPicker
classNames={classNames}
/>
);
}