Replies: 3 comments 1 reply
-
Hi @zfarhad this is an interesting case, thanks for sharing.
I'm working on this following the discussion in #1087 - so please have patience! Thanks! |
Beta Was this translation helpful? Give feedback.
-
We plan to implement this feature in v9. See #1833. |
Beta Was this translation helpful? Give feedback.
-
Support for Jalali language has been added to v9: react-day-picker.js.org/next/using-daypicker/localization#jalali-calendar. I would appreciate someone testing it - who can help? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi
I want to use React DayPicker in my project but I need to support jalali calendar (a different type of solar calendar).
By default, DayPicker uses date-fns library to calculate and manipulate date objects in JS. There is a forked version of date-fns library for jalali calendar system. (date-fns-jalali) I have installed date-fns-jalali library and forced DayPicker components to use this one instead of the date-fns library. It seems to be working properly.
My method is simple, I have installed date-fns-jalali library and give it the alias name date-fns. In this case, the components use the jalali version of date-fns instead of the original one and all dates automatically converted to jalali calendar.
But there is a problem with peerDependencies of DayPicker. When I tried to install DayPicker with npm install command, this does not understand the alias version and return the below error:
`
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! Found: react-day-picker@8.7.1
npm ERR! node_modules/react-day-picker
npm ERR! react-day-picker@"^8.7.1" from the root project
npm ERR! Could not resolve dependency:
npm ERR! react-day-picker@"^8.7.1" from the root project
npm ERR! Conflicting peer dependency: date-fns@2.30.0
npm ERR! node_modules/date-fns
npm ERR! peer date-fns@"^2.28.0" from react-day-picker@8.8.0
npm ERR! node_modules/react-day-picker
npm ERR! react-day-picker@"^8.7.1" from the root project
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
`
Can we make the date-fns dependency as optional? This will resolve the problem and anyone can use different versions of date-fns based on their needs.
Beta Was this translation helpful? Give feedback.
All reactions