Skip to content

feat(agenda): only show the overdue elements of the last three days #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lua/orgmode/agenda/types/agenda.lua
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,18 @@ end
function OrgAgendaType:_get_agenda_days()
local dates = self.from:get_range_until(self.to)
local agenda_days = {}
local three_days_before = self.from:adjust('-3d')

local headline_dates = {}
for _, orgfile in ipairs(self.files:all()) do
for _, headline in ipairs(orgfile:get_opened_headlines()) do
for _, headline_date in ipairs(headline:get_valid_dates_for_agenda()) do
table.insert(headline_dates, {
headline_date = headline_date,
headline = headline,
})
if headline_date >= three_days_before then
table.insert(headline_dates, {
headline_date = headline_date,
headline = headline,
})
end
end
end
end
Expand Down
Loading