Vue-js-cron Docs
Vue v2
Demo
Guide
API
Github
Vue v2
Demo
Guide
API
Github
    • Getting Started - Core
    • Getting Started - Light
    • Theming - Light
    • Getting Started - Ant
    • Getting Started - Element Plus
    • Getting Started - Naive UI
    • Getting Started - PrimeVue
    • Getting Started - Quasar
    • Getting Started - Vuetify
    • Custom Periods
    • Custom Cron Expression
    • Special Values

Special Values

Named months and weekdays

The crontab, quartz, and spring formats accept case-insensitive English abbreviations (JAN–DEC, SUN–SAT), regardless of the display locale. Lists, ranges, and supported step patterns work too: JAN,MAR, MON-FRI, JAN-MAY/2. Output is normalized to numeric values.

Names are enabled by default. Set namedValues: false to require numeric input:

<CronLight :format="{ inherit: 'crontab', namedValues: false }" v-model="expression" />

firstWeekDay controls weekday numbering and display order:

firstWeekDayItems in display orderSundayAlias when enabled
sun=00–607 → 0
mon=11–770 → 7
sun=11–71None
mon=22–7, 11None

hasSundayAlias defaults to true for crontab/Spring and false for Quartz. It can be overridden independently of namedValues. Crontab/Spring default to sun=0; Quartz defaults to sun=1.

Special days

The day of month field of the quartz and spring format supports the special values L and W.

ValueDescription
Llast day of the month
L-33 days before the last day of the month
LWlast weekday of the month
15Wweekday 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 * ?
Every
in
every month
on
every day
and
every day of the week
at
every 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 * *
Every
in
every month
on
every day
and
every day of the week
at
every 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 * * *
Every
in
every month
on
every day
and
every day of the week
at
every hour
:
every minute
:
every second
Contributors: Andreas Bichinger
Prev
Custom Cron Expression