From bb6bb101243fcd056796bad8f5e440834c3d1983 Mon Sep 17 00:00:00 2001 From: SebinSong Date: Tue, 20 Aug 2024 16:00:09 +1200 Subject: [PATCH] fix the issue --- frontend/views/containers/payments/PaymentsMixin.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/views/containers/payments/PaymentsMixin.js b/frontend/views/containers/payments/PaymentsMixin.js index 92d5e859e..6f4b9059b 100644 --- a/frontend/views/containers/payments/PaymentsMixin.js +++ b/frontend/views/containers/payments/PaymentsMixin.js @@ -15,6 +15,7 @@ const PaymentsMixin: Object = { 'dueDateForPeriod', 'groupPeriodPayments', 'groupSettings', + 'groupCreatedDate', 'groupSortedPeriodKeys', 'ourIdentityContractId', 'ourPayments', @@ -37,11 +38,15 @@ const PaymentsMixin: Object = { async getAllSortedPeriodKeys () { const currentDate = new Date() const distributionDate = new Date(this.groupSettings.distributionDate) + const groupCreatedDate = new Date(this.groupCreatedDate) const historicalPeriodPayments = Object.keys(await this.getHistoricalPeriodPayments()).sort() const periods = [ ...historicalPeriodPayments, ...this.groupSortedPeriodKeys - ].filter(period => new Date(period) <= currentDate) // show only started periods + ].filter(period => { + const dPeriod = new Date(period) + return dPeriod > new Date(groupCreatedDate) && dPeriod <= currentDate // show only started periods & filter out the 'waiting' period + }) // remove the waiting period from the list. it's useful for the contract but not in the UI if (periods.length === 1 && new Date(periods[0]) < distributionDate) { return []