Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Remove contribution range from PDF statement #6897

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions js/about/contributionStatement.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,30 +201,6 @@ class ContributionStatement extends ImmutableComponent {
)
}

get lastContributionHumanFormattedDate () {
if (!this.transactionIds || !this.transactionIds.length || !this.transaction) {
return ''
}

let transactionIds = this.transactionIds
let currentTxIdx = transactionIds.indexOf(this.transaction.get('viewingId'))
let lastTxIdx = (currentTxIdx ? currentTxIdx - 1 : -1)
let date = ''
if (lastTxIdx > -1) {
let previousTransaction = this.transactions.toJS()[lastTxIdx] || {}
let previousTimestamp = previousTransaction.submissionStamp

if (previousTimestamp && previousTimestamp < this.timestamp) {
date = longFormattedDateFromTimestamp(previousTimestamp)
}
}
return date
}

get thisContributionHumanFormattedDate () {
return longFormattedDateFromTimestamp(this.timestamp)
}

get rows () {
if (!this.transaction) {
// without a transaction there are no rows to process
Expand Down Expand Up @@ -266,9 +242,6 @@ class ContributionStatement extends ImmutableComponent {
return (
<div className='contributionStatementDetailTableContainer'>
<div>
<span className='statementDatesCoveredText pull-right'>
{ this.lastContributionHumanFormattedDate } - { this.thisContributionHumanFormattedDate }
</span>
<table className='contributionStatementDetailTable'>
<tbody>
<tr className='headingRow detailTableRow'>
Expand Down Expand Up @@ -416,11 +389,4 @@ function formattedTimeFromTimestamp (timestamp) {
return moment(new Date(timestamp)).format('h:mma')
}

function longFormattedDateFromTimestamp (timestamp) {
let momentDate = moment(new Date(timestamp))

// e.g. June 15th at 4:00pm
return `${momentDate.format('MMMM Do')} at ${momentDate.format('h:mma')}`
}

module.exports = <ContributionStatement />