diff --git a/website/docs/docs/customization.mdx b/website/docs/docs/customization.mdx index fa4e7174e..5d07c39d4 100644 --- a/website/docs/docs/customization.mdx +++ b/website/docs/docs/customization.mdx @@ -126,14 +126,16 @@ To display the column with week numbers, use the `showWeekNumber` prop. ### Handling Week Numbers Click -To handle clicks on the week numbers, you can set a custom `WeekNumber` [component](../guides/custom-components.mdx): +To handle clicks on the week numbers, you can set the `WeekNumber` [custom component](../guides/custom-components.mdx): ```tsx ( - + WeekNumber: (props) => ( + ) }} /> diff --git a/website/src/components/Playground/index.tsx b/website/src/components/Playground/index.tsx index 8a13e5283..de04bf9c6 100644 --- a/website/src/components/Playground/index.tsx +++ b/website/src/components/Playground/index.tsx @@ -67,8 +67,9 @@ export function Playground() { let formattedProps = ``; + })} />`; if (calendar === "Persian") { formattedProps = @@ -221,18 +222,20 @@ export function Playground() { min={1} max={12} size={4} - value={props.numberOfMonths} + value={props.numberOfMonths ?? ""} name="numberOfMonths" - onChange={(e) => + onChange={(e) => { + const value = e.target.value; setProps({ ...props, - numberOfMonths: Number(e.target.value) - }) - } + numberOfMonths: + value === "" ? undefined : Math.max(1, Number(value)) + }); + }} /> - {props.numberOfMonths && props.numberOfMonths > 1 && ( + {props.numberOfMonths !== undefined && props.numberOfMonths > 1 && (