mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 01:13:19 +00:00
15 lines
337 B
Text
15 lines
337 B
Text
|
import { Time } from "std-widgets.slint";
|
||
|
|
||
|
export global Utils {
|
||
|
pure function formatZeroPadding(number: int) -> string {
|
||
|
if (number < 10) {
|
||
|
return "0\{number}";
|
||
|
}
|
||
|
return number;
|
||
|
}
|
||
|
|
||
|
public pure function timeToString(time: Time) -> string {
|
||
|
return "\{formatZeroPadding(time.hour)}h\{formatZeroPadding(time.minute)}";
|
||
|
}
|
||
|
}
|