-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the American Samoa calendar (US territory)
closes #218
- Loading branch information
Showing
5 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from __future__ import (absolute_import, division, print_function, | ||
unicode_literals) | ||
from datetime import date | ||
|
||
from .core import UnitedStates | ||
from ..registry import iso_register | ||
|
||
|
||
@iso_register('US-AS') | ||
class AmericanSamoa(UnitedStates): | ||
"American Samoa" | ||
include_boxing_day = True | ||
boxing_day_label = "Family Day" | ||
|
||
def get_flag_day(self, year): | ||
""" | ||
Flag day is on April 17th | ||
""" | ||
return ( | ||
date(year, 4, 17), | ||
"Flag Day" | ||
) | ||
|
||
def get_variable_days(self, year): | ||
days = super(AmericanSamoa, self).get_variable_days(year) | ||
days.extend([ | ||
self.get_flag_day(year), | ||
]) | ||
return days |