From 620b1cb09a32b0546362a4c2c59e89090535e8f4 Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Sun, 2 Sep 2018 21:51:25 -0500 Subject: [PATCH] Sort transactions in reverse chronological order --- src/app/transaction.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/transaction.service.ts b/src/app/transaction.service.ts index 175f31f..90c2c5f 100644 --- a/src/app/transaction.service.ts +++ b/src/app/transaction.service.ts @@ -13,9 +13,9 @@ export class TransactionService { getTransactions(count?: number): Observable { if (count) { - return from(this.db.transactions.toCollection().limit(count).toArray()) + return from(this.db.transactions.orderBy('date').reverse().limit(count).toArray()) } else { - return from(this.db.transactions.toCollection().toArray()) + return from(this.db.transactions.orderBy('date').reverse().toArray()) } }