MCPcopy Index your code
hub / github.com/coder/coder / timeToCron

Function timeToCron

site/src/utils/schedule.tsx:234–244  ·  view source on GitHub ↗
(time: string, tz?: string)

Source from the content-addressed store, hash-verified

232};
233
234export const timeToCron = (time: string, tz?: string) => {
235 if (!validTime(time)) {
236 throw new Error(`Invalid time: ${time}`);
237 }
238 const [HH, mm] = time.split(":");
239 let prefix = "";
240 if (tz) {
241 prefix = `CRON_TZ=${tz} `;
242 }
243 return `${prefix}${Number(mm)} ${Number(HH)} * * *`;
244};
245
246export const quietHoursDisplay = (
247 browserLocale: string,

Callers 2

ScheduleFormFunction · 0.90
quietHoursDisplayFunction · 0.85

Calls 2

validTimeFunction · 0.85
NumberFunction · 0.85

Tested by

no test coverage detected