transactions.js
function Transactions (transactions, statement) {
  Transactions._injectPrototypeMethods(transactions)

  /**
   * Some financial institutions omit the year part in their date cells.
   * This workaround calculates the year for each transaction affected.
   */

  if (!/Y{2,}/.test(statement.dateFormat)) {
    if (!transactions.chronological()) transactions = transactions.reverse()

    var succeedingDate = statement.date
    for (var i = transactions.length - 1; i >= 0; i--) {
      var transaction = transactions[i]
      transaction.setDate({ succeedingDate: succeedingDate })
      succeedingDate = transaction.get('date')
    }
  }

  return transactions
}
function Transactions (transactions, statement) {
  Transactions._injectPrototypeMethods(transactions)

  /**
   * Some financial institutions omit the year part in their date cells.
   * This workaround calculates the year for each transaction affected.
   */

  if (!/Y{2,}/.test(statement.dateFormat)) {
    if (!transactions.chronological()) transactions = transactions.reverse()

    var succeedingDate = statement.date
    for (var i = transactions.length - 1; i >= 0; i--) {
      var transaction = transactions[i]
      transaction.setDate({ succeedingDate: succeedingDate })
      succeedingDate = transaction.get('date')
    }
  }

  return transactions
}
function Transactions ( transactions , statement ) { Transactions . _injectPrototypeMethods ( transactions ) /**
   * Some financial institutions omit the year part in their date cells.
   * This workaround calculates the year for each transaction affected.
   */ if ( ! / Y{2,} / . test ( statement . dateFormat ) ) { if ( ! transactions . chronological ( ) ) transactions = transactions . reverse ( ) var succeedingDate = statement . date for ( var i = transactions . length - 1 ; i >= 0 ; i -- ) { var transaction = transactions [ i ] transaction . setDate ( { succeedingDate : succeedingDate } ) succeedingDate = transaction . get ( 'date' ) } } return transactions }
An array-like class that represents a collection of transactions
@constructor
@param {Array} transactions - An array of Transaction objects
@param {Object} statement - The parent statement
@returns {Array} - An array of transactions with convenience methods
An array - like class that represents a collection of transactions