mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-13 11:20:31 +00:00
12 lines
291 B
TypeScript
12 lines
291 B
TypeScript
|
|
export function formatMinutes(totalMinutes: number) {
|
|
const minutes = totalMinutes % 60;
|
|
const hours = Math.floor(totalMinutes / 60);
|
|
|
|
return `${padTo2Digits(hours)}:${padTo2Digits(minutes)}`;
|
|
}
|
|
|
|
export function padTo2Digits(num: number) {
|
|
return num.toString().padStart(2, '0');
|
|
}
|