lib: clarify journalEndDate, add journalLastDay
This commit is contained in:
		
							parent
							
								
									7f2ad64e7b
								
							
						
					
					
						commit
						5d2caf3c7f
					
				| @ -60,6 +60,7 @@ module Hledger.Data.Journal ( | |||||||
|   journalDateSpanBothDates, |   journalDateSpanBothDates, | ||||||
|   journalStartDate, |   journalStartDate, | ||||||
|   journalEndDate, |   journalEndDate, | ||||||
|  |   journalLastDay, | ||||||
|   journalDescriptions, |   journalDescriptions, | ||||||
|   journalFilePath, |   journalFilePath, | ||||||
|   journalFilePaths, |   journalFilePaths, | ||||||
| @ -1316,11 +1317,16 @@ journalDateSpanHelper whichdate j = | |||||||
| journalStartDate :: Bool -> Journal -> Maybe Day | journalStartDate :: Bool -> Journal -> Maybe Day | ||||||
| journalStartDate secondary j = b where DateSpan b _ = journalDateSpan secondary j | journalStartDate secondary j = b where DateSpan b _ = journalDateSpan secondary j | ||||||
| 
 | 
 | ||||||
| -- | The latest of this journal's transaction and posting dates, or | -- | The "exclusive end date" of this journal: the day following its latest transaction  | ||||||
| -- Nothing if there are none. | -- or posting date, or Nothing if there are none. | ||||||
| journalEndDate :: Bool -> Journal -> Maybe Day | journalEndDate :: Bool -> Journal -> Maybe Day | ||||||
| journalEndDate secondary j = e where DateSpan _ e = journalDateSpan secondary j | journalEndDate secondary j = e where DateSpan _ e = journalDateSpan secondary j | ||||||
| 
 | 
 | ||||||
|  | -- | The latest of this journal's transaction and posting dates, or | ||||||
|  | -- Nothing if there are none. | ||||||
|  | journalLastDay :: Bool -> Journal -> Maybe Day | ||||||
|  | journalLastDay secondary j = addDays (-1) <$> journalEndDate 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