This release adds full support for the Persian calendar and a new numerals
prop to set the numbering system.
Breaking Change: Dropdown Formatters
The formatMonthDropdown
and formatYearDropdown
now receive a Date
(instead of a number
) as first argument.
<DayPicker formatters={{
- formatMonthDropdown: (month) => format(new Date(month), "mmmm") }}
+ formatMonthDropdown: (date) => format(date, "mmmm") }} />
- formatYearDropdown: (year) => format(new Date(year), "yyyy") }}
+ formatYearDropdown: (date) => format(date, "yyyy") }} />
/>
Persian Calendar
Persian Calendar get fulls support in DayPicker and replaces the previous "Jalali Calendar".
If you were using DayPicker from react-day-picker/jalali
, change your imports to react-day-picker/persian
:
- import { DayPicker } from `react-day-picker/jalali`;
+ import { DayPicker } from `react-day-picker/persian`;
See the Persian calendar documentation for more details about using Persian calendar in DayPicker.
What's Changed
- feat: add Persian calendar support by @gpbl in #2645
- feat: add new
numerals
prop by @gpbl in #2647 - feat: add
today
,newDate
,timeZone
to theDateLib
class by @gpbl in #2642 - feat: remove
startMonth
/endMonth
constraints when caption layout isdropdown-months
by @rodgobbi in #2648 - build: add
date-fns-jalali
to the package dependencies by @gpbl in #2640 - fix(breaking): dropdown formatters to use
dateLib
format by @gpbl in #2644 - fix(jalali): incorrect Jalali month names when using dropdown layouts by @gpbl in #2645
- fix(chore): always use
Date
constructor fromdateLib
by @gpbl in #2636 - fix(chore): use
dateLib
for getting days/months/years from aDate
by @gpbl in #2643
Full Changelog: v9.4.4...v9.5.0