Skip to content

Commit e4ef748

Browse files
committed
fix: get agenda view task line time colors from due breakpoints
1 parent 0b34373 commit e4ef748

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/neowarrior/components/AgendaComponent.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local TaskLine = require('neowarrior.lines.TaskLine')
22
local util = require('neowarrior.util')
3+
local colors = require('neowarrior.colors')
34

45
---@class AgendaComponent
56
local AgendaComponent = {}
@@ -68,9 +69,13 @@ function AgendaComponent:_set(tasks)
6869
})
6970
self.tram:into_line({})
7071

72+
table.sort(date.tasks, function(a, b) return a.due < b.due end)
73+
7174
for _, task in ipairs(date.tasks) do
7275

73-
self.tram:col(task.due_dt:format('%H:%M') .. ": ", { color = _Neowarrior.config.colors.dim.group })
76+
local time_color = colors.get_due_color(task.due_dt:diff_hours())
77+
self.tram:col(task.due_dt:format('%H:%M'), { color = time_color })
78+
self.tram:col(": ", {})
7479
TaskLine:new(self.tram, task):into_line({
7580
disable_due = true,
7681
})

0 commit comments

Comments
 (0)