diff --git a/.changeset/polite-mails-remain.md b/.changeset/polite-mails-remain.md new file mode 100644 index 0000000..2686ea7 --- /dev/null +++ b/.changeset/polite-mails-remain.md @@ -0,0 +1,5 @@ +--- +"@openfun/cunningham-react": minor +--- + +Add calendar system customization in `DatePicker` component diff --git a/packages/react/src/components/Forms/DatePicker/index.mdx b/packages/react/src/components/Forms/DatePicker/index.mdx index f6b4087..3984d22 100644 --- a/packages/react/src/components/Forms/DatePicker/index.mdx +++ b/packages/react/src/components/Forms/DatePicker/index.mdx @@ -122,6 +122,16 @@ When passing an invalid date, for example outside of the valid range, the DatePi +## International calendars + +When passing a locale value to the DatePicker components, dates would be automatically displayed in the appropriate calendar system. +By default, the DatePicker component uses the CunninghamProvider locale. + + + + + + ## Props You can see the list of props below. diff --git a/packages/react/src/components/Forms/DatePicker/index.stories.tsx b/packages/react/src/components/Forms/DatePicker/index.stories.tsx index 7757545..c9957a1 100644 --- a/packages/react/src/components/Forms/DatePicker/index.stories.tsx +++ b/packages/react/src/components/Forms/DatePicker/index.stories.tsx @@ -95,6 +95,26 @@ export const Fullwidth = { }, }; +export const CustomLocale = () => ( +
+ + + +
+); + +export const CunninghamLocale = () => ( +
+ + + +
+); + export const Controlled = () => { const [value, setValue] = useState("2023-05-26"); return (