Skip to content

New feature: Option for legacy dom-OR-dow  #53

Closed
@Hexagon

Description

@Hexagon

By default, croner work differently from the standard refered to by @vixie. If you specify both day-of-month and day-of-week ( 0 0 1 * MON) croner would only run when there is a monday at the 1st of any month. This enable you to set patterns that run on the first monday of any month (0 0 1-7 * MON) and other clever stuff.

In classic cron (Vixie, for example), day-of-month and day-of-week are ORed, which makes 0 0 1 * MON run at the 1st of any month AND at mondays.

	/* the dom/dow situation is odd.  '* * 1,15 * Sun' will run on the
	 * first and fifteenth AND every Sunday;  '* * * * Sun' will run *only*
	 * on Sundays;  '* * 1,15 * *' will run *only* the 1st and 15th.  this
	 * is why we keep 'e->dow_star' and 'e->dom_star'.  yes, it's bizarre.
	 * like many bizarre things, it's the standard.
	 */

Croner should support this with options, maybe

{ 
   legacyMode: true
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions