summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorIan2020 <Ian2020@users.noreply.github.com>2023-11-29 13:12:24 +0000
committerJohn Wiegley <johnw@newartisans.com>2024-08-06 11:08:15 -1000
commit762353945a744ae4b89970b9e08c2c22a52ddbff (patch)
tree1e3cc5fcbe4f89c5134f0fcb7a5f7ba3a8fb372d /src/filters.cc
parentb7be0a1fedfeec26e4b7d35357157d5a9209f3ee (diff)
downloadfork-ledger-762353945a744ae4b89970b9e08c2c22a52ddbff.tar.gz
fork-ledger-762353945a744ae4b89970b9e08c2c22a52ddbff.tar.bz2
fork-ledger-762353945a744ae4b89970b9e08c2c22a52ddbff.zip
Add new --align-intervals option.
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 3acb5624..b5b7fb19 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -974,7 +974,7 @@ void interval_posts::operator()(post_t& post)
if (interval.duration) {
all_posts.push_back(&post);
}
- else if (interval.find_period(post.date())) {
+ else if (interval.find_period(post.date(), align_intervals)) {
item_handler<post_t>::operator()(post);
}
}
@@ -991,10 +991,10 @@ void interval_posts::flush()
sort_posts_by_date());
// only if the interval has no start use the earliest post
- if (!(interval.begin() && interval.find_period(*interval.begin())))
+ if (!(interval.begin() && interval.find_period(*interval.begin(), align_intervals)))
// Determine the beginning interval by using the earliest post
if (all_posts.size() > 0 && all_posts.front()
- && !interval.find_period(all_posts.front()->date()))
+ && !interval.find_period(all_posts.front()->date(), align_intervals))
throw_(std::logic_error, _("Failed to find period for interval report"));
// Walk the interval forward reporting all posts within each one