[X] I have searched the existing issues and didn't find my feature already requested there
Feature description
I think the day_of_week field mapping between days and integers in the CronTrigger class is confusing and violates the principle of least astonishment. The CronTrigger is clearly named after the cron Unix tool, which, by convention, uses the integer 0 to refer to Sunday - however, the apscheduler implementation uses 0 as Monday. This nuance is not very clearly documented and this causes confusion to people migrating from e.g. cron.
While the decision to use 0 as Monday is not strictly a bug in itself (although given the choice, I would have taken a different approach when implementing the class), I personally found the documentation to be unclear and the subsequent application behaviour to be confusing. I had to resort to reading the code to validate the CronTrigger's behaviour when I was debugging a task.
I plan to add a PR to improve the docs if I get some time.
Use case
Having clearer documentation of potential "expectation violations" will help reduce the friction experienced by developers when using the CronTrigger class.
The 4.0 series of releases already changed 0 to mean Sunday. I could not do that in 3.x since it would have broken backwards compatibility. Do you need a documentation update for the 3.x series then?
Things to check first
Feature description
I think the
day_of_week
field mapping between days and integers in theCronTrigger
class is confusing and violates the principle of least astonishment. TheCronTrigger
is clearly named after thecron
Unix tool, which, by convention, uses the integer0
to refer to Sunday - however, theapscheduler
implementation uses0
as Monday. This nuance is not very clearly documented and this causes confusion to people migrating from e.g.cron
.While the decision to use
0
as Monday is not strictly a bug in itself (although given the choice, I would have taken a different approach when implementing the class), I personally found the documentation to be unclear and the subsequent application behaviour to be confusing. I had to resort to reading the code to validate theCronTrigger
's behaviour when I was debugging a task.I plan to add a PR to improve the docs if I get some time.
Use case
Having clearer documentation of potential "expectation violations" will help reduce the friction experienced by developers when using the
CronTrigger
class.