lib: journalStartDate, journalEndDate
This commit is contained in:
parent
1cacfcea28
commit
9ac1d7869b
@ -48,6 +48,8 @@ module Hledger.Data.Journal (
|
|||||||
traverseJournalAmounts,
|
traverseJournalAmounts,
|
||||||
-- journalCanonicalCommodities,
|
-- journalCanonicalCommodities,
|
||||||
journalDateSpan,
|
journalDateSpan,
|
||||||
|
journalStartDate,
|
||||||
|
journalEndDate,
|
||||||
journalDescriptions,
|
journalDescriptions,
|
||||||
journalFilePath,
|
journalFilePath,
|
||||||
journalFilePaths,
|
journalFilePaths,
|
||||||
@ -1040,6 +1042,16 @@ journalDateSpan secondary j
|
|||||||
pdates = concatMap (mapMaybe (if secondary then (Just . postingDate2) else pdate) . tpostings) ts
|
pdates = concatMap (mapMaybe (if secondary then (Just . postingDate2) else pdate) . tpostings) ts
|
||||||
ts = jtxns j
|
ts = jtxns j
|
||||||
|
|
||||||
|
-- | The earliest of this journal's transaction and posting dates, or
|
||||||
|
-- Nothing if there are none.
|
||||||
|
journalStartDate :: Bool -> Journal -> Maybe Day
|
||||||
|
journalStartDate secondary j = b where DateSpan b _ = journalDateSpan secondary j
|
||||||
|
|
||||||
|
-- | The latest of this journal's transaction and posting dates, or
|
||||||
|
-- Nothing if there are none.
|
||||||
|
journalEndDate :: Bool -> Journal -> Maybe Day
|
||||||
|
journalEndDate secondary j = e where DateSpan _ e = journalDateSpan secondary j
|
||||||
|
|
||||||
-- | Apply the pivot transformation to all postings in a journal,
|
-- | Apply the pivot transformation to all postings in a journal,
|
||||||
-- replacing their account name by their value for the given field or tag.
|
-- replacing their account name by their value for the given field or tag.
|
||||||
journalPivot :: Text -> Journal -> Journal
|
journalPivot :: Text -> Journal -> Journal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user