MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / formatTime

Function formatTime

src/lib/cron-parser.ts:47–54  ·  view source on GitHub ↗
(h: string, m: string)

Source from the content-addressed store, hash-verified

45
46 // Format time
47 const formatTime = (h: string, m: string): string => {
48 if (h === '*' || m === '*') return '';
49 const hourNum = parseInt(h);
50 const minNum = parseInt(m);
51 const period = hourNum >= 12 ? 'PM' : 'AM';
52 const hour12 = hourNum === 0 ? 12 : hourNum > 12 ? hourNum - 12 : hourNum;
53 return `${hour12}:${minNum.toString().padStart(2, '0')} ${period}`;
54 };
55
56 const time = formatTime(hour, minute);
57

Callers 1

cronToHumanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected