Skip to content

CronPicker

A cron expression picker component for scheduling tasks.

When to Use

Use when users need to configure cron expressions for scheduled or recurring tasks.

Basic Usage

Click the input to open the selection panel. Use presets for quick setup, or switch to "Custom" to scroll through values. Hold Ctrl while clicking to multi-select, generating comma-separated lists automatically. Next execution times are displayed below the input.

vue

<TCronPicker v-model="cron" />

Dialects

Use the format prop to select the cron dialect:

DialectFieldsDescription
linux5: minute hour dom month dowStandard Linux crontab (default)
webman5/6: [second] minute hour dom month dowWorkerman/Webman format, auto-downgrades when second is *
quartz7: second minute hour dom month dow yearJava Quartz format, supports ? wildcard
vue

<TCronPicker format="webman" />

Quartz Mode

Java Quartz format: 7 fields second minute hour dom month dow year. Day and week are mutually exclusive; the system automatically manages the ? wildcard.

vue

<TCronPicker format="quartz" />

Operators

Each field supports the following operators, selectable from the scrollable button list:

OperatorMeaningExample
*Any value* every minute
,List1,3,5 1st/3rd/5th of month (Ctrl+click to multi-select)
-Range9-17 9 AM to 5 PM
/Step*/5 every 5 minutes
?No specific value (Quartz only)?

Presets

PresetLinux ExpressionDescription
Every Minute* * * * *Run every minute
Hourly0 * * * *Run at the start of every hour
Daily0 0 * * *Run at midnight every day
Weekly0 0 * * 0Run at midnight every Sunday
Monthly0 0 1 * *Run at midnight on the 1st
Yearly0 0 1 1 *Run at midnight on Jan 1st

Next Run Times

Hover the clock icon next to the input to preview the next 5 execution times.

vue

<TCronPicker />

Localization

Customize UI text via the locale prop. All fields are optional; missing fields fall back to Chinese defaults.

The full set of configurable keys is defined in the CronLocaleMessages type (importable from @gulcc/tabler-vue):

vue

<TCronPicker
  format="quartz"
  :locale="{
    presetLabels: { everyMinute: 'Every Min', hourly: 'Hourly', daily: 'Daily', weekly: 'Weekly', monthly: 'Monthly', yearly: 'Yearly', custom: 'Custom' },
    fieldLabels: { second: 'Sec', minute: 'Min', hour: 'Hour', day: 'Day', month: 'Mon', week: 'Dow', year: 'Year' },
    confirm: 'OK',
    invalid: 'Invalid cron expression',
    nextRun: 'Next runs',
    everyPrefix: 'Every ',
    notSpecified: 'Not set (?)',
    multiSelectTitle: 'Multi-select',
    multiSelectHint: 'Hold Ctrl or Cmd to select multiple values',
    weekOptions: [
      { label: 'Every week', value: '*' },
      { label: 'Sun', value: '0' }, { label: 'Mon', value: '1' },
      { label: 'Tue', value: '2' }, { label: 'Wed', value: '3' },
      { label: 'Thu', value: '4' }, { label: 'Fri', value: '5' }, { label: 'Sat', value: '6' },
    ],
    weekOptionsQuartz: [
      { label: 'Every week', value: '*' }, { label: 'Not set (?)', value: '?' },
      { label: 'Sun', value: '1' }, { label: 'Mon', value: '2' },
      { label: 'Tue', value: '3' }, { label: 'Wed', value: '4' },
      { label: 'Thu', value: '5' }, { label: 'Fri', value: '6' }, { label: 'Sat', value: '7' },
    ],
    weekOptionsWebman: [
      { label: 'Every week', value: '*' },
      { label: 'Sun', value: '0' }, { label: 'Mon', value: '1' },
      { label: 'Tue', value: '2' }, { label: 'Wed', value: '3' },
      { label: 'Thu', value: '4' }, { label: 'Fri', value: '5' }, { label: 'Sat', value: '6' },
    ],
  }"
/>

Direct Input

Advanced users can type or paste cron expressions directly into the input. The expression is validated and synced to the panel on blur or Enter.

API

TCronPicker Props

PropDescriptionTypeDefault
model-valueCron expression (v-model)string'* * * * *'
formatDialect: linux / webman / quartzstring'linux'
disabledDisabledbooleanfalse
localeCustom UI textPartial<CronLocaleMessages>{}

TCronPicker Events

EventDescriptionParameters
update:model-valueExpression changed(value: string) => void
changeUser confirmed selection(value: string) => void