@niondigital/moco-mcp
Version:
Model Context Protocol (MCP) server for MOCO: time tracking, project management, holidays, and presence monitoring
43 lines (42 loc) • 1.33 kB
TypeScript
/**
* Time utility functions for formatting and calculations
*/
/**
* Converts decimal hours to HH:MM format
* @param hours - Hours as decimal number (e.g., 2.5)
* @returns Formatted time string (e.g., "2:30")
*/
export declare function formatHoursToHHMM(hours: number): string;
/**
* Sums an array of hour values
* @param hours - Array of hour values to sum
* @returns Total hours as decimal
*/
export declare function sumHours(hours: number[]): number;
/**
* Converts hours to days (assuming 8 hours = 1 working day)
* @param hours - Hours to convert
* @returns Days as decimal (e.g., 4 hours = 0.5 days)
*/
export declare function hoursToDays(hours: number): number;
/**
* Converts days to hours (assuming 8 hours = 1 working day)
* @param days - Days to convert
* @returns Hours as decimal
*/
export declare function daysToHours(days: number): number;
/**
* Rounds hours to 2 decimal places
* @param hours - Hours to round
* @returns Rounded hours
*/
export declare function roundHours(hours: number): number;
/**
* Creates a time format object with both decimal and formatted representations
* @param hours - Hours as decimal
* @returns Object with hours and hoursFormatted properties
*/
export declare function createTimeFormat(hours: number): {
hours: number;
hoursFormatted: string;
};