Skip to content

Commit

Permalink
fix: also show julian date in agenda
Browse files Browse the repository at this point in the history
Closes: #100
  • Loading branch information
b1rger committed Jan 13, 2024
1 parent 9652441 commit 3ca35b3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/output/agenda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//
// SPDX-License-Identifier: MIT

use crate::utils::convertstyle;
use crate::Context;
use anstyle::Style;

Expand All @@ -16,7 +17,13 @@ impl fmt::Display for Agenda<'_> {
let style = Style::default().bold();
let mut ret: String = format!("{}Agenda:{}\n", style.render(), style.render_reset());
for ei in self.ctx.eventinstances.iter() {
ret += format!("{ei}\n").as_str();
let datestr = if self.ctx.opts.julian {
format!("{}", ei.date.format("%j"))
} else {
format!("{}", ei.date)
};
let style = &convertstyle(ei.style.stylenames.to_vec(), "·");
ret += format!("{style} {datestr}: {}\n", ei.event.summary).as_str();
}
write!(f, "{}", ret)
}
Expand Down

0 comments on commit 3ca35b3

Please sign in to comment.