Skip to content

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

@DonBrinn

Description

@DonBrinn

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions