Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pickers] Reuse AdapterDateFnsBase in Jalali adapters #13075

Merged
merged 3 commits into from
May 13, 2024

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented May 10, 2024

Follow-up on #12891

  • Fix AdapterDateFnsJalali.test.tsx to test proper adapter
  • Reuse AdapterDateFnsBase in Jalali adapters

@LukasTy LukasTy added component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature labels May 10, 2024
@LukasTy LukasTy self-assigned this May 10, 2024
@mui-bot
Copy link

mui-bot commented May 10, 2024

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

Generated by 🚫 dangerJS against f27d384

@LukasTy LukasTy requested review from flaviendelangle and a team May 10, 2024 09:30
@@ -49,6 +49,12 @@ import { AdapterDateFnsBase } from '../AdapterDateFnsBase';

type DateFnsLocale = typeof defaultLocale;

declare module '@mui/x-date-pickers/models' {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move declarations back to the specific adapters to allow for reuse of AdapterDateFnsBase in Jalali adapters.

import { AdapterFormats } from '@mui/x-date-pickers/models';

describe('<AdapterDateFnsJalali />', () => {
describeJalaliAdapter(AdapterDateFnsJalali, {});

describe('Adapter localization', () => {
it('Formatting', () => {
const adapter = new AdapterMomentJalaali();
const adapter = new AdapterDateFnsJalali();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈 🤷

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣 My bad I guess

Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice improvement!

@LukasTy LukasTy merged commit 6824cc5 into mui:master May 13, 2024
19 checks passed
@LukasTy LukasTy deleted the date-fns-fixes branch May 13, 2024 09:35
arthurbalduini pushed a commit to arthurbalduini/mui-x that referenced this pull request May 23, 2024
DungTiger pushed a commit to DungTiger/mui-x that referenced this pull request Jul 23, 2024
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants