Angular Cron Generator

Quartz / Unix Cron expressions

Get Started

Native

As simple as Angular. Nothing else. The Bootstrap CSS is a optional dependency.

Customization

You can customize the component as you want.

Open-source and on npm

Use it directly in your project using npm.

Quartz / Unix cron expressions generator

Editing a plain text crontab is error-prone for task management, such as adding tasks, deleting tasks, or pausing tasks.
A little error can undoubtedly cut down every one of the positions and could set you back a great deal of time.

Angular cron widget allows you to create a cron expression string without any experience or understanding of cron standards.

This library contains solutions for quartz and unix formats.
Use with bootstrap CSS framework 5 or 4.
Angular cron npmAngular cron npm downloads
npm i @sbzen/ng-cron yarn add @sbzen/ng-cron

Quartz cron builder

Quartz cron expression is a representation of 7 values divided by single space.
Each value may have its own expression, such as 1-2, or 1,2 with various combinations of special characters.
Create a quartz cron expression with an easy-to-use online interface.

SecondsMinutesHoursDay Of MonthMonthDay Of WeekYear
0407?*MON-FRI*
@Component({
  template: `
    <input
      class="form-control"
      readonly
      [value]="quartzValue">

    <bs5-quartz-cron
      name="cron"
      [(ngModel)]="quartzValue">
    </bs5-quartz-cron>
  `
})
export class MyComponent {
  quartzValue = '0 40 7 ? * MON-FRI *';
}

import { Bs5QuartzCronModule } from '@sbzen/ng-cron';
@NgModule({
  imports: [Bs5QuartzCronModule]
})

Unix format builder

Unix cron expression supports 5 values divided by single space.
Same as quartz format, each value may have special characters and combinations.
This library helps you generate unix cron expressions to schedule tasks such as backups, emails, api calls and status checks.

MinutesHoursDay Of MonthMonthDay Of Week
0,2*/1*/4*/4?
@Component({
  template: `
    <input
      class="form-control"
      readonly
      [value]="unixValue">

    <bs5-unix-cron
      name="cron"
      [(ngModel)]="unixValue">
    </bs5-unix-cron>
  `
})
export class MyComponent {
  unixValue = '0,2 */1 */4 */4 ?';
}

import { Bs5UnixCronModule } from '@sbzen/ng-cron';
@NgModule({
  imports: [Bs5UnixCronModule]
})

What bootstrap version is compatible with this library?

We do support version 4 and 5, but you should use different components and modules.
These versions are not fully compatible with each other and this has led us to separate implementations.
Since version 4 is initial you can just use unix-cron and quartz-cron to work with bootstrap 4 like before.
And if you need bootstrap 5 use bs5-unix-cron, bs5-quartz-cron.

How can I translate this cron generator into another language?

All texts presented in cron generator are taken from localization scheme which defaults to English.
This approach provides flexibility in redefinition of texts.
Use localization input to pass your texts version.

Why unix cron doesn't have seconds tab?

The unix format restricts us from adding any extensions other than those described in the standard.
It supports 5 value segments, which are minutes, hours, day of month, month and day of week.
To comply with standards, seconds and years can't be added to unix component.

Can I customize component styles?

These components are designed to be ready for any style changes.
They are covered by an inner class schema that can't be changed, such classes are prefixed with c- and you can inspect them.
They are stable and you can use them to add your own corrections or re-styling.

Is it possible to disallow select year or any other segment?

There is no options to disable year or other segment.
There's only one way we can do this restriction is to specify which tabs you want to show in UI and simply not show tabs you want to disallow.
Pass the desired tabs to tabs input and viewing will be restricted.

Can you add support for more CSS frameworks?

The main thing here is not to integrate with external js, any other css solutions are welcome.
There is a list of potential candidates: Foundation, tailwindui, Semantic UI, Materialize, UI Kit.

© 2019-2024 code licensed under the MIT License.