-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
Deploy preview: https://deploy-preview-13075--material-ui-x.netlify.app/ |
@@ -49,6 +49,12 @@ import { AdapterDateFnsBase } from '../AdapterDateFnsBase'; | |||
|
|||
type DateFnsLocale = typeof defaultLocale; | |||
|
|||
declare module '@mui/x-date-pickers/models' { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣 My bad I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice improvement!
Follow-up on #12891
AdapterDateFnsJalali.test.tsx
to test proper adapterAdapterDateFnsBase
in Jalali adapters