Created
November 18, 2013 21:42
-
-
Save adamJLev/7535869 to your computer and use it in GitHub Desktop.
Gets US holidays rrules, to be used with python-dateutil and exrules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dateutil import rrule | |
from datetime import datetime | |
def get_schedule_holidays_rrules(): | |
return [ | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=1, bymonthday=1), # New Years | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=5, byweekday=rrule.MO(-1)), # Memorial | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=7, bymonthday=4), # Independence | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=11, byweekday=rrule.TH(4)), # Thanksgiving | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=12, bymonthday=25), # Christmas | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment