upgrade date-fns to v2.4.1
upgrade styled-components to v4.4.0
add typescript definitions
classes prop was extended
day- class for dayweekDay- class for weekDaymonthName- class for monthName
new prop:
firstWeekDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6- set day that will be displayed first (0issunday)
update styled components to 4.0.2
new props:
showMonthName: boolean- show / hide month namesshowWeekDayNames: boolean- show / hide week day namesweekDayFormat?: string- week day format, e.g.EweekDayFormatter?: Date => string- week day formatter function, e.g.day => format(day, 'E')(can be used to pass locale)monthNameFormatter?: Date => string- month name formatter function, e.g.month => format(month, 'MMMM yyyy')(can be used to pass locale)width?: number- custom base width of a single calendar (excluding margins)buttonBack?: React.Node- custom back button (will receive disabled prop)buttonForward?: React.Node- custom forwrad button (will receive disabled prop)
- fix onClick/onHover behaviour on hidden Dates
- new prop CustomTd React.ComponentType - shoudl be used as custom Day component in Calendar
- new props customClasses { [string]: Date[]} - the class (css) will be applied to the dates that are in the array
- styled-components are now
peerDependency
- new prop past - allow/disable past date selection (default
true) - new prop allowedDates - array of dates that are selectable (default
[]) when it's empty, all dates are selectable (except disabled dates) - new prop rangeSelect - if enabled, ranges can be selected, otherwise just one date (default
true)
numberOfMonths and numberOfPastMonths were removed, use firstMonth and lastMonth
numberOfMonths={1} -> firstMonth={new Date(2018, 1, 1)} // some month
numberOfPastMonths={1} -> lastMonth={new Date(2018, 2, 1)} // some month