Glm/fix cron builder (#4566)

* fix cron expression

* fix cron builder

* Fix prefilled schedule

---------

Co-authored-by: Guilhem <guilhem@mbp-de-windmill.home>
This commit is contained in:
Guilhem
2024-10-22 17:50:43 +02:00
committed by GitHub
co-authored by Guilhem
parent c8a2f8fee0
commit 32fd866ce9
2 changed files with 10 additions and 10 deletions
+9 -9
View File
@@ -112,26 +112,26 @@
// If using the basic editor, set the cron string based on the selected options
if (executeEvery === 'second') {
if (seconds > 0) {
nschedule = `*/${seconds} * * * *`
nschedule = `*/${seconds} * * * * *`
} else {
nschedule = `* * * * *`
nschedule = `* * * * * *`
}
} else if (executeEvery === 'minute') {
if (minutes > 0) {
nschedule = `0 */${minutes} * * *`
nschedule = `0 */${minutes} * * * *`
} else {
nschedule = `* * * * *`
nschedule = `* * * * * *`
}
} else if (executeEvery === 'hour') {
if (hours > 0) {
nschedule = `0 0 */${hours} * *`
nschedule = `0 0 */${hours} * * *`
} else {
nschedule = `* * * * *`
nschedule = `* * * * * *`
}
} else if (executeEvery === 'day-month') {
nschedule = `0 ${s_AtUTCMinutes} ${s_AtUTCHours} ${s_daysOfMonth} *`
nschedule = `0 ${s_AtUTCMinutes} ${s_AtUTCHours} ${s_daysOfMonth} * *`
} else if (executeEvery === 'month') {
nschedule = `0 ${s_AtUTCMinutes} ${s_AtUTCHours} ${s_daysOfMonth} ${s_months}`
nschedule = `0 ${s_AtUTCMinutes} ${s_AtUTCHours} ${s_daysOfMonth} ${s_months} *`
} else if (executeEvery === 'day-week') {
nschedule = `0 ${s_AtUTCMinutes} ${s_AtUTCHours} * * ${s_daysOfWeek}`
}
@@ -214,7 +214,7 @@
type="text"
id="cron-schedule"
name="cron-schedule"
placeholder="*/30 * * * *"
placeholder="0 0 */1 * * *"
bind:value={schedule}
{disabled}
/>
@@ -218,7 +218,7 @@
$primarySchedule = {
summary: '',
args: {},
cron: '0 0 0 /1 * * *',
cron: '0 0 */1 * * *',
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
enabled: true
}