harrisiirak/cron-parser

expression has inconsistent behaviour for time ranges that span Daylight Saving Time change

DonBrinn opened this issue · 0 comments

Steps to reproduce:

const parser = require('cron-parser');
let interval;

// the following call prints `'2020-11-01T06:10:00.000Z'`
interval = parser.parseExpression('* 10 1 * * 0', { tz: 'America/Toronto', currentDate: '2020-11-01T06:00:00.000Z' , endDate: '2020-11-01T06:30:00.000Z'}).next().toISOString();

// the following call has a slightly *larger* time range, but throws Error `Out of the timespan range`.
interval = parser.parseExpression('* 10 1 * * 0', { tz: 'America/Toronto', currentDate: '2020-11-01T05:55:00.000Z' , endDate: '2020-11-01T06:30:00.000Z'}).next().toISOString();