22 lines
707 B
TypeScript
22 lines
707 B
TypeScript
export type ClockOutOutcome =
|
|
| "linked_to_invoice"
|
|
| "saved_no_invoice"
|
|
| "saved_no_client"
|
|
| "zero_hours";
|
|
|
|
export const DEFAULT_CLOCK_DESCRIPTION = "Clock In";
|
|
export const LEGACY_DEFAULT_CLOCK_DESCRIPTION = "Professional services";
|
|
|
|
export function formatElapsedSeconds(seconds: number): string {
|
|
const h = Math.floor(seconds / 3600);
|
|
const m = Math.floor((seconds % 3600) / 60);
|
|
const s = seconds % 60;
|
|
return [h, m, s].map((value) => String(value).padStart(2, "0")).join(":");
|
|
}
|
|
|
|
export function formatElapsedHoursMinutes(seconds: number): string {
|
|
const h = Math.floor(seconds / 3600);
|
|
const m = Math.floor((seconds % 3600) / 60);
|
|
return `${h}:${String(m).padStart(2, "0")}`;
|
|
}
|