fix: sort by days-since numerically
This commit is contained in:
parent
6f769af5a5
commit
a7c74feb63
1 changed files with 3 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ mod get {
|
||||||
#[derive(serde::Serialize, Debug, Clone)]
|
#[derive(serde::Serialize, Debug, Clone)]
|
||||||
struct TaskWithSince {
|
struct TaskWithSince {
|
||||||
task: Task,
|
task: Task,
|
||||||
since: String,
|
since: f64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::ops::Deref for TaskWithSince {
|
impl std::ops::Deref for TaskWithSince {
|
||||||
|
|
@ -86,7 +86,7 @@ mod get {
|
||||||
let mut by_freq = last_completions
|
let mut by_freq = last_completions
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|task| TaskWithSince {
|
.map(|task| TaskWithSince {
|
||||||
since: since(&task.datestamp).unwrap().to_string(),
|
since: since(&task.datestamp).unwrap(),
|
||||||
task: task,
|
task: task,
|
||||||
})
|
})
|
||||||
.fold(
|
.fold(
|
||||||
|
|
@ -172,7 +172,7 @@ mod get {
|
||||||
a href=(format!("/task/{}", task.id)) { (PreEscaped(markdown::to_html(&task.description))) }
|
a href=(format!("/task/{}", task.id)) { (PreEscaped(markdown::to_html(&task.description))) }
|
||||||
}
|
}
|
||||||
span .since id=(format!("since-{}", task.id)) {
|
span .since id=(format!("since-{}", task.id)) {
|
||||||
(task.since)
|
(task.since.to_string())
|
||||||
}
|
}
|
||||||
span .datestamp {
|
span .datestamp {
|
||||||
(task.datestamp.as_ref().map_or("never", |v| v))
|
(task.datestamp.as_ref().map_or("never", |v| v))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue