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] DatePicker distribution #14918

Open
michelengelen opened this issue Oct 11, 2024 · 1 comment
Open

[pickers] DatePicker distribution #14918

michelengelen opened this issue Oct 11, 2024 · 1 comment
Labels
component: pickers This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@michelengelen
Copy link
Member

michelengelen commented Oct 11, 2024

I have exactly the same issue described by @BenByrdInMarket on his initial message.
I will try to create a small reproduction case.
In the meantime, the only solution I have is to wrap my design system components in a LocalizationProvider and to pass dateAdapter and adapterLocale as props. It's not great however.
e.g.
On my design system side:

import { DatePickerProps } from '@mui/x-date-pickers-pro';
import { PickerValidDate } from '@mui/x-date-pickers/models';

interface CustomDatePicker extends DatePickerProps<TDate, TEnableAccessibleFieldDOMStructure> {
  dateAdapter?: any;
  adapterLocale?: any;
}
import { DatePicker, LocalizationProvider } from '@mui/x-date-pickers-pro';

function CustomDatePicker<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false>(props: CustomDatePicker<TDate, TEnableAccessibleFieldDOMStructure>) {
  const { dateAdapter, adapterLocale, ...rest } = props;

  return (
    <LocalizationProvider dateAdapter={dateAdapter} adapterLocale={adapterLocale}>
      <DatePicker ... />
    </LocalizationProvider>
  );
}

On my app side (that consume the design system):

import { AdapterDateFns } from '@mui/x-date-pickers-pro/AdapterDateFns';
import { fr } from 'date-fns/locale';

<CustomDatePicker dateAdapter={AdapterDateFns} adapterLocale={fr} />

PS: @flaviendelangle this issue has been closed. is it possible to reopen it? Do you need my reproduction case? Can I create a support ticket with my premium support subscription?

If you could open up a new ticket and include your specific reproduction that would help a lot. This issue is kind of old and also has unrelated information. So it would be best to start a fresh issue and link this (or specific comments) for reference.

If you can include the premium order-id that would be great as well.

Thanks! 🙇🏼

Hi @michelengelen,

We have created a specific reproduction case that you can find here:

https://github.com/Seb-GRAF/design-system-consumer
https://github.com/Seb-GRAF/design-system

We have a MUI X Premium license. Here is our support key / order ID: 96178

Best,

Originally posted by @guicara in #5349 (comment)

Search keywords:

@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 11, 2024
@michelengelen michelengelen added component: pickers This is the name of the generic UI component, not the React module! support: commercial Support request from paid users support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/ labels Oct 11, 2024
@michelengelen
Copy link
Member Author

@LukasTy I have extracted this from the mentioned ticket since it got very noisy. Could you have a look when you have some time on your hands?

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! status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

No branches or pull requests

1 participant