mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.82k stars 1.14k forks source link

[pickers] Add `AdapterDateFnsJalaliV3` adapter #12891

Closed smmoosavi closed 1 week ago

smmoosavi commented 3 weeks ago

AdapterDateFnsJalaliV3

I am trying to add AdapterDateFnsJalaliV3 to x-date-pickers

babel config problem. solved but I have a problem with the Babel config to replace `date-fns-jalali` with `date-fns-jalali-v3`. can anyone help to fix the problem? ```ts // in AdapterDateFnsJalaliV3.ts console.log(module.children.map(f => f.filename)) ``` ```ts [ '/.../mui-x/node_modules/date-fns-jalali/addSeconds/index.js', '/.../mui-x/node_modules/date-fns-jalali/addMinutes/index.js', '/.../mui-x/node_modules/date-fns-jalali/addHours/index.js', '/.../mui-x/node_modules/date-fns-jalali/addDays/index.js', // ... ] ```
github-actions[bot] commented 3 weeks ago

This pull request has conflicts, please resolve those before we can evaluate the pull request.

smmoosavi commented 1 week ago

I found the problem with the Babel config. the patches/babel-plugin-replace-imports@1.0.2.patch patch had hard-coded AdapterDateFnsV3.ts

- _ref2.filename.includes('AdapterDateFnsV3.ts')
+ _ref2.filename.includes(_ref2.opts.filenameIncludes || '')
smmoosavi commented 1 week ago

I hope this pull request is ready for review. I tried to have well-separated commits, especially separated copy and rename commits will help in the review process

@LukasTy

mui-bot commented 1 week ago

Deploy preview: https://deploy-preview-12891--material-ui-x.netlify.app/

Updated pages:

Generated by :no_entry_sign: dangerJS against 4a68033a50d40915aef8e021a809e72ed03eab24

smmoosavi commented 1 week ago

Thanks.

P.S. This adapter will be released with the next v7 release. If there are enough requests, we can back-port it to v6. 😉 Does that make sense? 🤔

yes.