diff --git a/src/index.ts b/src/index.ts index f69c172..97406e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -838,7 +838,13 @@ function cronToSystemdCalendars(cron: string): string[] { for (const domValue of domValues) { for (const monthValue of months) { for (const dowValue of dowValues) { - calendars.push(`${dowValue} *-${monthValue}-${domValue} ${hourValue}:${minuteValue}:00`) + const datePart = `*-${monthValue}-${domValue}` + const timePart = `${hourValue}:${minuteValue}:00` + const calendar = + dowValue === "*" + ? `${datePart} ${timePart}` + : `${dowValue} ${datePart} ${timePart}` + calendars.push(calendar) } } }