-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8fb332e
commit 696d11e
Showing
2 changed files
with
73 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from .. import Provider as DateTimeProvider | ||
|
||
|
||
class Provider(DateTimeProvider): | ||
MONTH_NAMES = { | ||
"01": "一月", | ||
"02": "二月", | ||
"03": "三月", | ||
"04": "四月", | ||
"05": "五月", | ||
"06": "六月", | ||
"07": "七月", | ||
"08": "八月", | ||
"09": "九月", | ||
"10": "十月", | ||
"11": "十一月", | ||
"12": "十二月", | ||
} | ||
|
||
TRADITIONAL_MONTH_NAMES = { | ||
"01": "睦月", | ||
"02": "如月", | ||
"03": "弥生", | ||
"04": "卯月", | ||
"05": "皐月", | ||
"06": "水無月", | ||
"07": "文月", | ||
"08": "葉月", | ||
"09": "長月", | ||
"10": "神無月", | ||
"11": "霜月", | ||
"12": "師走", | ||
} | ||
DAY_NAMES = { | ||
"0": "日曜日", | ||
"1": "月曜日", | ||
"2": "火曜日", | ||
"3": "水曜日", | ||
"4": "木曜日", | ||
"5": "金曜日", | ||
"6": "土曜日", | ||
} | ||
|
||
def day_of_week(self) -> str: | ||
day = self.date("%w") | ||
return self.DAY_NAMES[day] | ||
|
||
def month_name(self) -> str: | ||
month = self.month() | ||
return self.MONTH_NAMES[month] | ||
|
||
def traditional_month_name(self) -> str: | ||
month = self.month() | ||
return self.TRADITIONAL_MONTH_NAMES[month] |
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