Might be a bug. Crons strings (Weekly vs Monthly on weeknumber and day of week) #1857
Unanswered
s3YwCf2ZbfJG4SHAfjQMAjtsf
asked this question in
General
Replies: 1 comment
-
I don't think there's a bug in the sense of output. For Quartz 3 is Tuesday. But for libraries like cron expression descriptor it would be easier to get output of TUE so you wouldn't need to configure the library to understand where the week starts from. var trigger = (ICronTrigger) TriggerBuilder.Create()
.WithSchedule(CronScheduleBuilder.WeeklyOnDayAndHourAndMinute(DayOfWeek.Tuesday, 5, 10))
.Build();
Console.WriteLine($"CRON: {trigger.CronExpressionString}");
Console.WriteLine($"Next fire times: {string.Join(", ", TriggerUtils.ComputeFireTimes((IOperableTrigger) trigger, null, 3))}"); Outputs:
So fires will happen on Tuesdays. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I reported a bug with CronExpressionDescriptor for Weekly as shown Quartz.Net vs CED vs cronmaker.com:
bradymholt/cron-expression-descriptor#161
However, I found that
Weekly Tuesday at a time: 0 10 5 ? * 3 - At 05:10 AM, only on Wednesday <= It should be Tuesday, but 3 instead of TUE is used.
The above generates: 0 10 5 ? * 3, instead of with TUE.
vs:
Monthly on the second Thursday at a time: 0 45 9 ? 1/1 THU#2 * - At 09:45 AM, on the second Thursday of the month
Is there an issue in CronScheduleBuilder that it should output the 3 character day of the week instead of the number? Especially since day of week is 0 based, and the 3 should be 2 for Tuesday.
When I look at the CronExpression on the trigger of job with that cron, it shows as TUE.
Beta Was this translation helpful? Give feedback.
All reactions