CronPicker is a javascript library that provides easy to use interface for generating CRON expressions.
I've forked this great project to add few improvements necessary to me:
- Added support for: every minutes, hours, days.
- Changed UI for my requirements.
- Just for dev: new gulp task to watch and edit file at runtime.
You can use http-server and gulp watch to work on it and add your changes.
- Supports multiple CRON formats: crontab (StandardCronFormatter) and extended format used in Quartz Scheduler (QuartzCronFormatter)
- Can be initialized with an existing CRON expression
npm install bootstrap-cron-picker
Using Bower:
bower install bootstrap-cron-picker
To attach CronPicker to an input field with id #cron-picker
:
$('#cron-picker').cronPicker();
You can also initialize CronPicker with existing cron expression. To do that, simply set value of the HTML input before attaching CronPicker.
For advanced usage, you can pass any of the following options:
$('#cron-picker').cronPicker({
// time format, either 12 hours or 24 hours (default)
format: '24',
// available formatters:
// - StandardCronFormatter (crontab specification)
// - QuartzCronFormatter (quartz.net specification)
cronFormatter: StandardCronFormatter,
// callback function called each time cron expression is updated
onCronChanged: function (cron) {
console.log(cron);
}
});