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 []