mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[pickers] Remove `TDate` generics in favor of `PickerValidDate` direct usage

Open flaviendelangle opened this issue 1 year ago • 12 comments

Closes #14796

Side note: all PickerValidDate | null passed as a generic will be replaced with a true or false once TValue is replaced by TIsRange (phrase 2 of #14823).

I will do the migration guide after the phase 2 of #14823 to have a finalized list of the breaking changes on the generics.

flaviendelangle avatar Oct 16 '24 17:10 flaviendelangle

Localization writing tips :writing_hand:

Seems you are updating localization :earth_africa: files.

Thank you for contributing to the localization! :tada: To make your PR perfect, here is a list of elements to check: :heavy_check_mark:

  • [ ] Verify if the PR title respects the release format. Here are two examples (depending if you update or add a locale file)

    [l10n] Improve Swedish (sv-SE) locale [l10n] Add Danish (da-DK) locale

  • [ ] Update the documentation of supported locales by running pnpm l10n
  • [ ] Clean files with pnpm prettier.

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

Updated pages:

Generated by :no_entry_sign: dangerJS against 9683c453972c4f1f3d55f51d41e46b279583ef5c

mui-bot avatar Oct 17 '24 07:10 mui-bot

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

github-actions[bot] avatar Oct 17 '24 18:10 github-actions[bot]

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

github-actions[bot] avatar Oct 22 '24 15:10 github-actions[bot]

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

github-actions[bot] avatar Oct 25 '24 13:10 github-actions[bot]

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

github-actions[bot] avatar Oct 29 '24 09:10 github-actions[bot]

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

github-actions[bot] avatar Oct 29 '24 13:10 github-actions[bot]

Have you tried exploring a solution of localized PickerValidDate redefining? 🤔

How would you do that?

flaviendelangle avatar Oct 29 '24 13:10 flaviendelangle

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

github-actions[bot] avatar Oct 29 '24 13:10 github-actions[bot]

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

github-actions[bot] avatar Oct 29 '24 14:10 github-actions[bot]

@LukasTy one option would be to add the following code in one of the doc files:

declare module '@mui/x-date-pickers/models' {
  interface PickerValidDateLookup {
    fakeDocAdapter: any;
  }
}

It would not impact Codesandbox / Stackblitz. We would have any as a value in the doc examples but I don't think we care since today we have the union of all the date library types and we never really missed this type safety.

flaviendelangle avatar Oct 31 '24 07:10 flaviendelangle

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

github-actions[bot] avatar Oct 31 '24 10:10 github-actions[bot]

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

github-actions[bot] avatar Oct 31 '24 14:10 github-actions[bot]