mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-01 17:03:19 +00:00
14 lines
337 B
Text
14 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)}";
|
|
}
|
|
}
|