Skip to content

Lack of minute should not pass the validation #244

Open
@lvqq

Description

@lvqq
  • cron-parser version: 4.0.0
  • node: 14.16.0

as the title, when i use expression like 20 15 * *, it pass the validation and becomes * 20 15 * * by default, i think the expression without minute should not pass the validation because minute is not optional but required.

also, the expression 20 15 * * does not pass the validation in other package or site like https://crontab.guru/

image

here is the sample, the function parseExpression should throw a error but not:

const parser = require('cron-parser');
try {
  const interval = parser.parseExpression('20 15 * *');
  interval.next();  // 2021-10-15 20:00:00
  interval.next();  // 2021-10-15 20:01:00
  interval.next();  // 2021-10-15 20:02:00
} catch(e) {
  console.log(e);
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions