From d7798983183802c7940c345faf1b036d9b7c0397 Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Thu, 20 Feb 2025 10:34:19 +1100 Subject: [PATCH] docs: update SingleDatePicker prop documentation to clarify date format and examples --- public/vite.svg | 1 - src/components/SingleDatePicker.tsx | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) delete mode 100644 public/vite.svg diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/SingleDatePicker.tsx b/src/components/SingleDatePicker.tsx index 4b248af..8c83d8c 100644 --- a/src/components/SingleDatePicker.tsx +++ b/src/components/SingleDatePicker.tsx @@ -5,7 +5,10 @@ interface Props { /** * Control the selected * date programmatically, including situations like provide a default value or control the selected - * date by parent component. + * date by parent component. Use 1-12 for month, instead of 0-11, if you are using object to set the + * value. + * @example { year: 2025, month: 1, day: 1 } + * @example new Date(2025, 0, 1) * @default new Date() */ value?: Date | { year: number, month: number, day: number } @@ -13,7 +16,8 @@ interface Props { /** * A callback function that will be called when a date is selected inside the panel. * @param date - The date user selected. - * @returns + * @returns {{ year: number, month: number, day: number }} - The date user selected. + * @example { year: 2025, month: 1, day: 1 } // User selected 1 Jan 2025 */ onSelect?: (date: { year: number,