# @winarg/ngx-cron-editor

> A cron expression generator for Angular 17+

Latest version **18.1.2** (published 2025-11-17) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 18.1.2 |
| Published | 2025-11-17 |
| First published | 2021-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 372.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Håvard Dagenborg Johansen |
| Maintainers | aroussos |
| Keywords | angular, cron, cron-expression, angular-cli, quartz |

## Links

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

## Dependencies (1)

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

## Recent versions

- 18.1.2 (latest) — 2025-11-17
- 18.1.1 — 2025-11-17
- 18.1.0 — 2025-11-17
- 18.0.1 — 2024-10-08
- 18.0.0 — 2024-10-06
- 17.0.0 — 2024-04-03
- 0.10.1 — 2023-01-04
- 0.10.0 — 2022-12-23
- 0.9.3 — 2022-06-10
- 0.9.2 — 2022-05-09
- 0.9.1 — 2022-02-06
- 0.8.6 — 2021-12-04
- 0.8.5 — 2021-11-05
- 0.8.4 — 2021-10-29
- 0.8.3 — 2021-10-29
- … 1 more at https://npm.io/package/@winarg/ngx-cron-editor/versions

## README

ngx-cron-editor
===

An Angular 17 component for building cron expressions graphically. It is meant
to be used in reactive forms and support Angular Material Design styling.
 

## Demo

Forked from [here](https://winarg.github.io/ngx-cron-editor/)

A work-in-progress demo can be found [here](https://stackblitz.com/edit/angular-ngx-cron-editor?file=src/app/app.component.html)

## Usage

1. Install the npm package:
    ```
    $ npm i @winarg/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)].

Then, a new fork was made in order to upgrade to Angular 13, remove jQuery and fix an issue when bidnig value to a reactive form.

**The main additions of this fork is support for Angular 13+ and material design.**


## License:
Licensed under the MIT license

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