Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ registerOptionPreset('YOUR-PRESET-ID', {
useAliases: false, // optional, default to false
useBlankDay: false,
allowOnlyOneBlankDayField: false,
allowStepping: true, // optional, defaults to true
mustHaveBlankDayField: false, // optional, default to false
useLastDayOfMonth: false, // optional, default to false
useLastDayOfWeek: false, // optional, default to false
Expand Down Expand Up @@ -161,6 +162,9 @@ The preset properties explained:
- enables blank day notation '?' in daysOfMonth and daysOfWeek field
- `allowOnlyOneBlankDayField: boolean`
- requires a day field to not be blank (so not both day fields can be blank)
- `allowStepping: boolean`
- optional, will default to true
- when set to false, disallows the use of the '/' operation for valid expressions
- `mustHaveBlankDayField: boolean`
- requires a day field to be blank (so not both day fields are specified)
- when mixed with `allowOnlyOneBlankDayField`, it means that there will always be either day or day of week as `?`
Expand Down Expand Up @@ -200,14 +204,14 @@ If you want to override a option for single cron validations, you can use the `o

```typescript
console.log(cron('* * * * * *', {
preset: 'default' // second field not supported in default preset
preset: 'default', // second field not supported in default preset
override: {
useSeconds: true // override preset option
}
}))

console.log(cron('* 10-20 * * * *', {
preset: 'default'
preset: 'default',
override: {
minutes: {
lowerLimit: 10, // override preset option
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
Expand Down
Loading