HangfireIO / Cronos

A fully-featured .NET library for working with Cron expressions. Built with time zones in mind and intuitively handles daylight saving time transitions
MIT License
1.01k stars 120 forks source link

Fortnight how to run a Job every Fortnight , It's every second SAT. or /14 days. #63

Open georgioua opened 11 months ago

georgioua commented 11 months ago

Fortnight how to run a Job every Fortnight , It's every second SAT. or /14 days.

aravind-alapati commented 11 months ago

This 0 0 * * 6#2 should work, reference: https://github.com/HangfireIO/Cronos#cron-format

georgioua commented 10 months ago

6=SAT Is SUN=0 or 7? MON=1 ?

aravind-alapati commented 10 months ago

Both 0 and 7 means SUN and MON =1

image

georgioua commented 9 months ago

This is not fortnight still. It's every second Saturday of the month.

aravind-alapati commented 9 months ago

Isn't it what you asked for ? image

christianhsmebye commented 6 months ago

Have the same problem here. I want to run a job every second friday. The Cron expression "0 0 5#2,5#4" will run every other Friday, that is, the second and fourth Friday of each month. Starting from today (May 3, 2024), the next runs in 2024 will be: May: 10th (2nd Friday) and 24th (4th Friday) June: 14th (2nd Friday) and 28th (4th Friday) July: 12th (2nd Friday) and 26th (4th Friday) August: 9th (2nd Friday) and 23rd (4th Friday)

The problem here is that there is not every second friday: May: 10th and 24th June: 7th and 21th July: 5th and 19th August: 2th, 16th and 30th.

May is OK, but from June... not OK.

So, the feature request here is a kind of "skip". Ex: skip 0 means every occation, skip 1 means that you skip one occation, skip 2 means that you skip two occation etc. This means that you need a "fromDate" or something to indicate start of the first occation.

This would be very helpful! Thanks!