Fix duration handlebars helper
This commit is contained in:
@ -12,8 +12,8 @@ pub fn register_helpers(engines: &mut Engines) {
|
|||||||
.register_helper("pretty_datetime", Box::new(pretty_datetime));
|
.register_helper("pretty_datetime", Box::new(pretty_datetime));
|
||||||
|
|
||||||
handlebars_helper!(pretty_seconds: |secs: u64| {
|
handlebars_helper!(pretty_seconds: |secs: u64| {
|
||||||
let minutes = secs / 60;
|
let hours = secs / 60 / 60;
|
||||||
let hours = minutes / 60;
|
let minutes = secs / 60 % 60;
|
||||||
if hours > 0 {
|
if hours > 0 {
|
||||||
format!("{}h {}m", hours, minutes)
|
format!("{}h {}m", hours, minutes)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user