Print dates in a nicer format
This commit is contained in:
parent
531a140c45
commit
3e70b2e2c9
5 changed files with 67 additions and 5 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -28,13 +28,19 @@ fn main() -> anyhow::Result<()> {
|
|||
|
||||
let range = DateRange::new(
|
||||
NaiveDate::from_ymd(2021, 1, 1),
|
||||
NaiveDate::from_ymd(2021, 12, 31),
|
||||
NaiveDate::from_ymd(2022, 12, 31),
|
||||
)
|
||||
.unwrap();
|
||||
println!("{:#?}", files.eval(EntryMode::Relevant, range));
|
||||
for entry in files.eval(EntryMode::Relevant, range)? {
|
||||
let title = files.command(entry.source).title();
|
||||
if let Some(dates) = entry.dates {
|
||||
println!("{:36} - {}", format!("{}", dates), title);
|
||||
} else {
|
||||
println!("{:36} - {}", "undated", title);
|
||||
}
|
||||
}
|
||||
|
||||
files.mark_all_dirty();
|
||||
files.save()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue