P4sca1 / cron-schedule

A zero-dependency cron parser and scheduler for Node.js, Deno and the browser.
MIT License
172 stars 14 forks source link

Incorrect values returned for getPrevDate #313

Closed ilya-v-trofimov closed 4 months ago

ilya-v-trofimov commented 4 months ago

Hi, When running this code:

let schedule = parseCronExpression('0 10 * * 3')
wedSched.getPrevDate(new Date('2024-05-01T09:00:00'))

expected result is: 2024-04-24T00:00:00.000Z actual result is: 2024-03-27T00:00:00.000Z

Node: 20.12.2

P4sca1 commented 4 months ago

Hey @ilya-v-trofimov 👋 Thank you for pointing out this issue. It should be fixed in version 5.0.0. It is a major release, as support for Node.js 16 has also been dropped. Other than that, the API is unchanged. If you still have issues, please reopen this issue.

P4sca1 commented 4 months ago

Release for version 5.0.0 failed. Use version 5.0.1 instead.