forked from janek/mostr
fix: more consistent time-tracking history
This commit is contained in:
parent
1263e39fb3
commit
13dac88ded
|
@ -562,7 +562,8 @@ async fn main() -> Result<()> {
|
||||||
if let Some(arg) = arg {
|
if let Some(arg) = arg {
|
||||||
if tasks.track_from(arg) {
|
if tasks.track_from(arg) {
|
||||||
let (label, times) = tasks.times_tracked();
|
let (label, times) = tasks.times_tracked();
|
||||||
println!("{}\n{}", label.italic(), times.rev().take(15).join("\n"));
|
println!("{}\n{}", label.italic(),
|
||||||
|
times.rev().take(15).collect_vec().iter().rev().join("\n"));
|
||||||
}
|
}
|
||||||
// TODO show history of author / pubkey
|
// TODO show history of author / pubkey
|
||||||
} else {
|
} else {
|
||||||
|
@ -578,7 +579,8 @@ async fn main() -> Result<()> {
|
||||||
Some(arg) => {
|
Some(arg) => {
|
||||||
if parse_tracking_stamp(arg).and_then(|stamp| tasks.track_at(stamp, None)).is_some() {
|
if parse_tracking_stamp(arg).and_then(|stamp| tasks.track_at(stamp, None)).is_some() {
|
||||||
let (label, times) = tasks.times_tracked();
|
let (label, times) = tasks.times_tracked();
|
||||||
println!("{}\n{}", label.italic(), times.rev().take(15).join("\n"));
|
println!("{}\n{}", label.italic(),
|
||||||
|
times.rev().take(15).collect_vec().iter().rev().join("\n"));
|
||||||
}
|
}
|
||||||
// So the error message is not covered up
|
// So the error message is not covered up
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -189,7 +189,7 @@ impl Tasks {
|
||||||
for event in set {
|
for event in set {
|
||||||
let new = some_non_empty(&event.tags.iter()
|
let new = some_non_empty(&event.tags.iter()
|
||||||
.filter_map(|t| t.content())
|
.filter_map(|t| t.content())
|
||||||
.map(|str| EventId::from_str(str).ok().map_or(str.to_string(), |id| self.get_task_title(&id)))
|
.map(|str| EventId::from_str(str).ok().map_or(str.to_string(), |id| self.get_task_path(Some(id))))
|
||||||
.join(" "));
|
.join(" "));
|
||||||
if new != last {
|
if new != last {
|
||||||
// TODO alternate color with grey between days
|
// TODO alternate color with grey between days
|
||||||
|
|
Loading…
Reference in New Issue