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
numeralsprop by @gpbl in #2647 - feat: add
today,newDate,timeZoneto theDateLibclass by @gpbl in #2642 - feat: remove
startMonth/endMonthconstraints when caption layout isdropdown-monthsby @rodgobbi in #2648 - build: add
date-fns-jalalito the package dependencies by @gpbl in #2640 - fix(breaking): dropdown formatters to use
dateLibformat by @gpbl in #2644 - fix(jalali): incorrect Jalali month names when using dropdown layouts by @gpbl in #2645
- fix(chore): always use
Dateconstructor fromdateLibby @gpbl in #2636 - fix(chore): use
dateLibfor getting days/months/years from aDateby @gpbl in #2643
Full Changelog: v9.4.4...v9.5.0