From b2b9aba791fee081f92aec4d450f1d3e281c41b8 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 3 Jul 2007 19:06:47 +0000 Subject: [PATCH] sort register by date --- Ledger.hs | 1 - Utils.hs | 2 ++ hledger.hs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Ledger.hs b/Ledger.hs index cfa72ec86..19a654d90 100644 --- a/Ledger.hs +++ b/Ledger.hs @@ -2,7 +2,6 @@ module Ledger where import qualified Data.Map as Map import Data.Map ((!)) -import Data.Ord (comparing) import Utils import Types diff --git a/Utils.hs b/Utils.hs index bb20e4b20..c9b3fffca 100644 --- a/Utils.hs +++ b/Utils.hs @@ -4,6 +4,7 @@ module Utils ( module Char, module Data.List, module Data.Tree, + module Data.Ord, module Text.Printf, module Text.Regex, module Debug.Trace, @@ -14,6 +15,7 @@ where import Char import Data.List import Data.Tree +import Data.Ord import Text.Printf import Text.Regex import Debug.Trace diff --git a/hledger.hs b/hledger.hs index 609edd5c2..6a2e199c5 100644 --- a/hledger.hs +++ b/hledger.hs @@ -45,7 +45,7 @@ register opts acctpats descpats = do where printRegister l = putStr $ showTransactionsWithBalances - (ledgerTransactionsMatching (acctpats,descpats) l) + (sortBy (comparing date) (ledgerTransactionsMatching (acctpats,descpats) l)) 0 balance :: [Flag] -> [String] -> [String] -> IO ()