From 35cc2a564f605ede636d8d21da33c5558a19860f Mon Sep 17 00:00:00 2001 From: Jaied Al Sabid <87969327+jaieds@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:18:03 +0600 Subject: [PATCH 1/5] Update changelog.txt --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 7c0fbbd4..05bf1d4d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,4 @@ -Version 1.3.2 - 17th December, 2024 +Version 1.3.2 - 18th December, 2024 Fixed - Adjusted the color of the Switch component label and help text. Version 1.3.1 - 17th December, 2024 From eebe69f2cb8efa81e7e7bc74a5f15122d1d1626c Mon Sep 17 00:00:00 2001 From: Jaied Al Sabid <87969327+jaieds@users.noreply.github.com> Date: Mon, 30 Dec 2024 12:55:27 +0600 Subject: [PATCH 2/5] imprv: Added a prop to set initial value of the date picker --- src/components/datepicker/datepicker.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/datepicker/datepicker.tsx b/src/components/datepicker/datepicker.tsx index 6e6b5349..709916cd 100644 --- a/src/components/datepicker/datepicker.tsx +++ b/src/components/datepicker/datepicker.tsx @@ -33,6 +33,8 @@ export interface DatePickerProps { showOutsideDays?: boolean; /** Show or hide the footer. */ isFooter?: boolean; + /** Selected date value. */ + selected?: Date | Date[] | TDateRange | null; } const DatePicker = ( { @@ -46,11 +48,15 @@ const DatePicker = ( { cancelButtonText = 'Cancel', showOutsideDays = true, isFooter = true, + selected, ...props }: DatePickerProps ) => { const [ selectedDates, setSelectedDates ] = useState< TDateRange | Date | Date[] | null >( () => { + if ( selected ) { + return selected; + } if ( selectionType === 'multiple' ) { return []; } else if ( selectionType === 'range' ) { From e2de5d84f012714ff113cf8fc236905b2c1a3554 Mon Sep 17 00:00:00 2001 From: Jaied Al Sabid <87969327+jaieds@users.noreply.github.com> Date: Mon, 30 Dec 2024 13:02:18 +0600 Subject: [PATCH 3/5] fix: DatePicker crashing after selecting year --- src/components/datepicker/datepicker-component.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/datepicker/datepicker-component.tsx b/src/components/datepicker/datepicker-component.tsx index 4c45f865..340260f4 100644 --- a/src/components/datepicker/datepicker-component.tsx +++ b/src/components/datepicker/datepicker-component.tsx @@ -175,7 +175,7 @@ const DatePickerComponent = ( { } }; - const handleYearClick = ( { yearValue }: { yearValue: number } ) => { + const handleYearClick = ( yearValue: number ) => { setSelectedYear( yearValue ); setShowYearSelect( false ); setShowMonthSelect( true ); @@ -245,13 +245,7 @@ const DatePickerComponent = ( {