# ngx-cron-editor

> A cron expression generator for Angular 15+

Latest version **0.10.2** (published 2025-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-cron-editor
pnpm add ngx-cron-editor
yarn add ngx-cron-editor
bun add ngx-cron-editor
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.10.2 |
| Published | 2025-11-05 |
| First published | 2018-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 281.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Author | Håvard Dagenborg |
| Maintainers | haavardj |
| Keywords | angular, cron, cron-expression, angular-cli, quartz |

## Links

- npm: https://www.npmjs.com/package/ngx-cron-editor
- Repository: https://github.com/haavardj/ngx-cron-editor
- Issues: https://github.com/haavardj/ngx-cron-editor/issues
- npm.io page: https://npm.io/package/ngx-cron-editor

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Recent versions

- 0.10.2 (latest) — 2025-11-05
- 0.10.1 — 2024-10-25
- 0.10.0 — 2024-10-03
- 0.9.0 — 2024-10-02
- 0.8.4 — 2024-10-01
- 0.8.3 — 2024-09-23
- 0.8.2 — 2024-04-17
- 0.8.1 — 2024-02-05
- 0.8.0 — 2024-02-04
- 0.7.11 — 2023-12-24
- 0.7.10 — 2023-12-11
- 0.7.9 — 2023-08-16
- 0.7.9-0 — 2023-08-14
- 0.7.8 — 2023-07-04
- 0.7.7 — 2023-07-03
- … 19 more at https://npm.io/package/ngx-cron-editor/versions

## README

ngx-cron-editor
===

An Angular 15+ component for building cron expressions graphically. It is meant
to be used in reactive forms and support Angular Material Design styling.
 

## Demo

A demo can be found [here](https://haavardj.github.io/ngx-cron-editor/)

## Usage

1. Install the npm package:
    ```
    $ npm i ngx-cron-editor -S
    ```

2. Import the module in your own module:

    ```ts
    import { CronEditorModule } from 'ngx-cron-editor';

    @NgModule({
        imports: [..., CronEditorModule],
    ...
    })
    export class MyModule {
    }
    ```

3. Setup the FormControl in you component's typescript file:
   
   ```ts
   ngOnInit(): void {
     this.cronForm = new FormControl('0 0 1/1 * *');
   }
   ```
   
4. Include the component in your html code:

    ```html
    <cron-editor [formControl]="cronForm"></cron-editor>
    ```
   
   or use the `formControlName='...'` directive if your form controller
   lives in a FormGroup.

## Options

```html
<cron-editor [formControl]="cronForm" [options]="cronOptions"></cron-editor>
```

```ts
import { CronOptions } from 'ngx-cron-editor';

@Component({
    ...
})
export class MyComponent {
   public cronOptions: CronOptions = {
       defaultTime: "00:00:00",

       hideMinutesTab: false,
       hideHourlyTab: false,
       hideDailyTab: false,
       hideWeeklyTab: false,
       hideMonthlyTab: false,
       hideYearlyTab: false,
       hideAdvancedTab: true,
       hideSpecificWeekDayTab: false,
       hideSpecificMonthWeekTab : false,

       use24HourTime: true,
       hideSeconds: false,

       cronFlavor: "quartz" //standard or quartz
    };
}
```

## History

The ngx-cron-editor is a fork of the vincentjames501's [angular-cron-gen](https://github.com/vincentjames501/angular-cron-gen) for AngularJS 1.5+ and claudiuconstantin's [cron-editor(https://github.com/claudiuconstantin/cron-editor)]. 

**The main additions of this fork is support for Angular 8+ and material design.**


## License:
Licensed under the MIT license

---
_Source: https://npm.io/package/ngx-cron-editor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
