Skip to content

Commit

Permalink
Merge pull request #36590 from dukenv0307/fix/34763
Browse files Browse the repository at this point in the history
fix logic get year
  • Loading branch information
tgolen authored Feb 20, 2024
2 parents 9c4c4ac + dc45f0a commit 8bfb264
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const CONST = {
},

DATE_BIRTH: {
MIN_AGE: 5,
MIN_AGE: 0,
MIN_AGE_FOR_PAYMENT: 18,
MAX_AGE: 150,
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/DatePicker/CalendarPicker/YearPickerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function YearPickerModal({isVisible, years, currentYear = new Date().getFullYear
const yearsList = searchText === '' ? years : years.filter((year) => year.text.includes(searchText));
return {
headerMessage: !yearsList.length ? translate('common.noResultsFound') : '',
sections: [{data: yearsList, indexOffset: 0}],
sections: [{data: yearsList.sort((a, b) => b.value - a.value), indexOffset: 0}],
};
}, [years, searchText, translate]);

Expand Down Expand Up @@ -78,6 +78,7 @@ function YearPickerModal({isVisible, years, currentYear = new Date().getFullYear
initiallyFocusedOptionKey={currentYear.toString()}
showScrollIndicator
shouldStopPropagation
shouldUseDynamicMaxToRenderPerBatch
/>
</ScreenWrapper>
</Modal>
Expand Down

0 comments on commit 8bfb264

Please sign in to comment.