histogram: honour the specified start or end dates
This commit is contained in:
		
							parent
							
								
									2b1ea5160f
								
							
						
					
					
						commit
						eac34e85fa
					
				@ -23,14 +23,14 @@ histogram opts args j = do
 | 
				
			|||||||
  putStr $ showHistogram opts (optsToFilterSpec opts args t) j
 | 
					  putStr $ showHistogram opts (optsToFilterSpec opts args t) j
 | 
				
			||||||
 | 
					
 | 
				
			||||||
showHistogram :: [Opt] -> FilterSpec -> Journal -> String
 | 
					showHistogram :: [Opt] -> FilterSpec -> Journal -> String
 | 
				
			||||||
showHistogram opts filterspec j = concatMap (printDayWith countBar) dayps
 | 
					showHistogram opts filterspec j = concatMap (printDayWith countBar) spanps
 | 
				
			||||||
    where
 | 
					    where
 | 
				
			||||||
      i = intervalFromOpts opts
 | 
					      i = intervalFromOpts opts
 | 
				
			||||||
      interval | i == NoInterval = Days 1
 | 
					      interval | i == NoInterval = Days 1
 | 
				
			||||||
               | otherwise = i
 | 
					               | otherwise = i
 | 
				
			||||||
      fullspan = journalDateSpan j
 | 
					      span = datespan filterspec `orDatesFrom` journalDateSpan j
 | 
				
			||||||
      days = filter (DateSpan Nothing Nothing /=) $ splitSpan interval fullspan
 | 
					      spans = filter (DateSpan Nothing Nothing /=) $ splitSpan interval span
 | 
				
			||||||
      dayps = [(s, filter (isPostingInDateSpan s) ps) | s <- days]
 | 
					      spanps = [(s, filter (isPostingInDateSpan s) ps) | s <- spans]
 | 
				
			||||||
      -- same as Register
 | 
					      -- same as Register
 | 
				
			||||||
      -- should count transactions, not postings ?
 | 
					      -- should count transactions, not postings ?
 | 
				
			||||||
      ps = sortBy (comparing postingDate) $ filterempties $ filter matchapats $ filterdepth $ journalPostings j
 | 
					      ps = sortBy (comparing postingDate) $ filterempties $ filter matchapats $ filterdepth $ journalPostings j
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user