Fix formatting of /stats
This commit is contained in:
@ -14,10 +14,12 @@ pub fn register_helpers(engines: &mut Engines) {
|
||||
handlebars_helper!(pretty_seconds: |secs: u64| {
|
||||
let hours = secs / 60 / 60;
|
||||
let minutes = secs / 60 % 60;
|
||||
if hours > 0 {
|
||||
format!("{}h {}m", hours, minutes)
|
||||
} else {
|
||||
if hours == 0 {
|
||||
format!("{}m", minutes)
|
||||
} else if minutes == 0 {
|
||||
format!("{}h", hours)
|
||||
} else {
|
||||
format!("{}h {}m", hours, minutes)
|
||||
}
|
||||
});
|
||||
engines
|
||||
|
||||
Reference in New Issue
Block a user