dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.71k stars 960 forks source link

Add the functionality to run jobs at monthly or yearly intervals on specific dates #565

Open masa-08 opened 1 year ago

masa-08 commented 1 year ago

resolve #487

This PR will implement the feature discussed in the above issue.

To summarize this issue

Therefore, I have implemented the feature that allows scheduling on a monthly or yearly unit by specifying a specific date.

This feature can be used as follows

# Run jobs on the 5th of each month.
schedule.every().date("05").do(job)
# Run jobs at 9:00 on Dec 5th every two years.
schedule.every(2).date("12/05").at("09:00").do(job)

Your review and comments would be greatly appreciated.

c0d3rman commented 11 months ago

Any progress on merging this? I also need this functionality.

detheavn commented 9 months ago

I agree monthly and yearly would be great additions, but I would like to make an additional suggestion for the monthly, namely the first and last of the month with offsets: .firstof() would then be the 1st of the month .lastof() would be the last of the month.

Offsets could then be done as follows: .firstof(1) would then be the 2nd of the month .lastoff(1) would then be the day before the last day of the month.

Benjythebee commented 3 months ago

bump, PR becoming stale?