Display category children & Add calendar stats

This commit is contained in:
2021-04-30 14:48:42 +02:00
parent e8e8f535c2
commit c3870bcded
22 changed files with 759 additions and 338 deletions

View File

@ -11,6 +11,19 @@ pub fn register_helpers(engines: &mut Engines) {
.handlebars
.register_helper("pretty_datetime", Box::new(pretty_datetime));
handlebars_helper!(pretty_compact_seconds: |secs: u64| {
let hours = secs / 60 / 60;
let minutes = secs / 60 % 60;
if hours == 0 {
format!("{}m", minutes)
} else {
format!("{}h", hours)
}
});
engines
.handlebars
.register_helper("pretty_compact_seconds", Box::new(pretty_compact_seconds));
handlebars_helper!(pretty_seconds: |secs: u64| {
let hours = secs / 60 / 60;
let minutes = secs / 60 % 60;