From 2e78a5393194ded54d672decddd5b111a2eadd7a Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 9 Oct 2025 17:11:44 -1000 Subject: [PATCH] ;dev: dayPartitionSpans -> dayPartitionStartEnd --- hledger-lib/Hledger/Data/DayPartition.hs | 6 +++--- hledger-lib/Hledger/Reports/ReportOptions.hs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hledger-lib/Hledger/Data/DayPartition.hs b/hledger-lib/Hledger/Data/DayPartition.hs index 959263cea..d301772ba 100644 --- a/hledger-lib/Hledger/Data/DayPartition.hs +++ b/hledger-lib/Hledger/Data/DayPartition.hs @@ -14,7 +14,7 @@ module Hledger.Data.DayPartition , maybeDayPartitionToDateSpans -- * operations , unionDayPartitions -, dayPartitionSpans +, dayPartitionStartEnd , lookupDayPartition , splitSpan , intervalBoundaryBefore @@ -125,8 +125,8 @@ unionDayPartitions (DayPartition (PeriodData h as)) (DayPartition (PeriodData h' equalIntersection x y = and $ IM.intersectionWith (==) x y -- | Get this DayPartition's overall start date and end date (both inclusive). -dayPartitionSpans :: DayPartition -> (Day, Day) -dayPartitionSpans (DayPartition (PeriodData _ ds)) = +dayPartitionStartEnd :: DayPartition -> (Day, Day) +dayPartitionStartEnd (DayPartition (PeriodData _ ds)) = -- Guaranteed not to error because the IntMap is non-empty. (intToDay . fst $ IM.findMin ds, snd $ IM.findMax ds) diff --git a/hledger-lib/Hledger/Reports/ReportOptions.hs b/hledger-lib/Hledger/Reports/ReportOptions.hs index 5040f1296..80bbc377a 100644 --- a/hledger-lib/Hledger/Reports/ReportOptions.hs +++ b/hledger-lib/Hledger/Reports/ReportOptions.hs @@ -673,7 +673,7 @@ journalApplyValuationFromOptsWith rspec@ReportSpec{_rsReportOpts=ropts} j priceo postingperiodend = postingPeriodEnd . postingDateOrDate2 (whichDate ropts) where postingPeriodEnd d = fromMaybe err $ case interval_ ropts of - NoInterval -> fmap (snd . dayPartitionSpans) . snd $ reportSpan j rspec + NoInterval -> fmap (snd . dayPartitionStartEnd) . snd $ reportSpan j rspec _ -> fmap (snd . lookupDayPartition d) . snd $ reportSpanBothDates j rspec -- Should never happen, because there are only invalid dayPartitions -- when there are no transactions, in which case this function is never called @@ -824,7 +824,7 @@ reportSpanHelper bothdates j ReportSpec{_rsQuery=query, _rsReportOpts=ropts, _rs -- The requested span enlarged to enclose a whole number of intervals. -- This can be the null span if there were no intervals. enlargedreportspan = dbg3 "enlargedreportspan" $ - maybe (DateSpan Nothing Nothing) (mkSpan . dayPartitionSpans) intervalspans + maybe (DateSpan Nothing Nothing) (mkSpan . dayPartitionStartEnd) intervalspans where mkSpan (s, e) = DateSpan (Just $ Exact s) (Just . Exact $ addDays 1 e) reportStartDate :: Journal -> ReportSpec -> Maybe Day