Skip to content

0 25 7 4-22 8 1-5 2025 should not run on Sat or Sun, but it does #32

@Steve-Mcl

Description

@Steve-Mcl

Hi @jaclarke - I hope you are well.

It has been reported via my Node-RED Node that the expression 0 25 7 4-22 8 1-5 2025 ran on a Saturday.

Indeed, as I run this expression today on a Saturday, it indicates the next date will be tomorrow, Sunday.

example: Ran at 17:35 BST

const cronosjs = require('cronosjs')
const expression = cronosjs.CronosExpression.parse('0 25 7 4-22 8 1-5 2025', undefined)
console.log(expression)
/*
CronosExpression {
  cronString: '0 25 7 4-22 8 1-5 2025',
  seconds: [ 0 ],
  minutes: [ 25 ],
  hours: [ 7 ],
  days: DaysFieldValues {
    lastDay: false,
    lastWeekday: false,
    days: [
       4,  5,  6,  7,  8,  9, 10,
      11, 12, 13, 14, 15, 16, 17,
      18, 19, 20, 21, 22
    ],
    nearestWeekday: [],
    daysOfWeek: [ 1, 2, 3, 4, 5 ],
    lastDaysOfWeek: [],
    nthDaysOfWeek: []
  },
  months: [ 8 ],
  years: YearsField {
    field: '2025',
    first: 1970,
    last: 2099,
    _items: [ [FieldItem] ]
  },
  skipRepeatedHour: true,
  missingHour: 'insert',
  _warnings: null,
  timezone: undefined
}
*/
expression.nextDate() // 2025-08-10T06:25:00.000Z -- 10th Aug is a Sunday

I would greatly appreciate a fix but I understand if you do not have the time or inclination so a pointer to where I could fix this and I will fork and fix it myself would be equally good.

Thanks as always, Steve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions