A cron expression generator for Angular 17+
npm install @winarg/ngx-cron-editorngx-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.
$ 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
`
or use the formControlName='...' directive if your form controller
lives in a FormGroup.
Options
`html
`
`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
};
}
``