diff --git a/src/components/views/project/projectDonations/QfRoundSelector.tsx b/src/components/views/project/projectDonations/QfRoundSelector.tsx index 9f6feba4ea..726f585e86 100644 --- a/src/components/views/project/projectDonations/QfRoundSelector.tsx +++ b/src/components/views/project/projectDonations/QfRoundSelector.tsx @@ -37,9 +37,13 @@ export const QfRoundSelector: FC<IQfRoundSelectorProps> = ({ const navigationNextRef = useRef(null); const sortedRounds = - projectData?.qfRounds?.sort( - (a, b) => Number(b.isActive) - Number(a.isActive), - ) || []; + projectData?.qfRounds?.sort((a: IQFRound, b: IQFRound) => { + const activeFirstCompare = Number(b.isActive) - Number(a.isActive); + if (activeFirstCompare === 0) { + return new Date(b.beginDate) > new Date(a.beginDate) ? 1 : -1; + } + return activeFirstCompare; + }) || []; const isRecurringSelected = projectDonationSwiperState.isRecurringSelected; const selectedQF = projectDonationSwiperState.selectedQF;