(time: string, tz?: string)
| 232 | }; |
| 233 | |
| 234 | export 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 | |
| 246 | export const quietHoursDisplay = ( |
| 247 | browserLocale: string, |
no test coverage detected