forked from MapComplete/MapComplete
Cluster styling tweaks, tweaks to NP
This commit is contained in:
parent
8f674b7976
commit
adb36c2ffe
6 changed files with 30 additions and 32 deletions
26
Utils.ts
26
Utils.ts
|
@ -78,18 +78,6 @@ export class Utils {
|
|||
return res;
|
||||
}
|
||||
|
||||
static DoEvery(millis: number, f: (() => void)) {
|
||||
if (Utils.runningFromConsole) {
|
||||
return;
|
||||
}
|
||||
window.setTimeout(
|
||||
function () {
|
||||
f();
|
||||
Utils.DoEvery(millis, f);
|
||||
}
|
||||
, millis)
|
||||
}
|
||||
|
||||
public static NoNull<T>(array: T[]): T[] {
|
||||
const ls: T[] = [];
|
||||
for (const t of array) {
|
||||
|
@ -440,5 +428,19 @@ export class Utils {
|
|||
window.setTimeout(resolve, timeMillis);
|
||||
})
|
||||
}
|
||||
|
||||
public static toHumanTime(seconds): string{
|
||||
seconds = Math.floor(seconds)
|
||||
let minutes = Math.floor(seconds / 60)
|
||||
seconds = seconds % 60
|
||||
let hours = Math.floor(minutes / 60)
|
||||
minutes = minutes % 60
|
||||
let days = Math.floor(hours / 24)
|
||||
hours = hours % 24
|
||||
if(days > 0){
|
||||
return days+"days"+" "+hours+"h"
|
||||
}
|
||||
return hours+":"+Utils.TwoDigits(minutes)+":"+Utils.TwoDigits(seconds)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue