Special Values
The day of month field of the quartz and spring format supports the special values L and W.
| Value | Description |
|---|---|
L | last day of the month |
L-3 | 3 days before the last day of the month |
LW | last weekday of the month |
15W | weekday nearest to the 15th of the month |
L and LW are part of the items of the day field, therefore they can be selected like any other value. L-<n> and <n>W are parsed and displayed, but they have to be set through v-model.
Special values can't be combined with other values, e.g. L,15 is not a valid day of month.
0 0 0 L * ?
Everyin
every month
onevery day
andevery day of the week
atevery hour
:every minute
:every second
Other formats
The special values are disabled for the crontab format, because crontab doesn't support them. specialDays enables them for any format.
<template>
<div>
<div class="mb-2">{{ value }}</div>
<CronLight v-model="value" :format="format" @error="error = $event" />
</div>
</template>
<script>
export default {
data() {
return {
value: '0 0 L * *',
error: '',
format: { specialDays: true },
}
},
}
</script>
0 0 L * *
Everyin
every month
onevery day
andevery day of the week
atevery hour
:every minute
Disable Special Values
To disable the special values for quartz and spring formats, set specialDays to false.
<template>
<div>
<div class="mb-2">{{ value }}</div>
<CronLight v-model="value" :format="format" @error="error = $event" />
</div>
</template>
<script>
export default {
data() {
return {
value: '0 0 0 * * *',
error: '',
format: { inherit: 'spring', specialDays: false },
}
},
}
</script>
0 0 0 * * *
Everyin
every month
onevery day
andevery day of the week
atevery hour
:every minute
:every second