Skip to content

Commit

Permalink
Change month field start from 1 instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
CreeperSan committed Sep 12, 2023
1 parent 03ded75 commit 2454807
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ The database table name is `days`, all Chinese text in database is Traditional C
|------------------|---------|--------------------------------------------|
| id | INTEGER | Primary Key |
| year | INTEGER | Year in Gregorian calendar |
| month | INTEGER | Month in Gregorian calendar, starts from 0 |
| month | INTEGER | Month in Gregorian calendar, starts from 1 |
| day | INTEGER | Day in Gregorian calendar |
| weekday | INTEGER | Weekday, 1 means Sunday, 2 means Monday |
| lunar_year | INTEGER | Lunar Year |
| lunar_month | INTEGER | Lunar Month, starts from 0 |
| lunar_month | INTEGER | Lunar Month, starts from 1 |
| lunar_day | INTEGER | Lunar Day |
| is_leap_month | INTEGER | Is Lunar Leap Month |
| lunar_year_name | TEXT | Lunar year name in Traditional Chinese |
Expand Down
4 changes: 2 additions & 2 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
|------------------|---------|--------------------|
| id | INTEGER | 主键 |
| year | INTEGER | 对应公历的年 |
| month | INTEGER | 对应公历的月, 从 0 开始 |
| month | INTEGER | 对应公历的月, 从 1 开始 |
| day | INTEGER | 对应公历的日 |
| weekday | INTEGER | 对应星期, 1 为周日, 2 为周一 |
| lunar_year | INTEGER | 对应农历的年 |
| lunar_month | INTEGER | 对应农历的月, 从 0 开始 |
| lunar_month | INTEGER | 对应农历的月, 从 1 开始 |
| lunar_day | INTEGER | 对应农历的日 |
| is_leap_month | INTEGER | 是否为闰月 |
| lunar_year_name | TEXT | 农历年份的名称 |
Expand Down
24 changes: 12 additions & 12 deletions src/02_generate_database_from_chinese_calendar_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@
MONTH_DECEMBER = '十二月'

MONTH_MAPPING = {
MONTH_JANUARY: 0,
MONTH_FEBRUARY: 1,
MONTH_MARCH: 2,
MONTH_APRIL: 3,
MONTH_MAY: 4,
MONTH_JUNE: 5,
MONTH_JULY: 6,
MONTH_AUGUST: 7,
MONTH_SEPTEMBER: 8,
MONTH_OCTOBER: 9,
MONTH_NOVEMBER: 10,
MONTH_DECEMBER: 11
MONTH_JANUARY: 1,
MONTH_FEBRUARY: 2,
MONTH_MARCH: 3,
MONTH_APRIL: 4,
MONTH_MAY: 5,
MONTH_JUNE: 6,
MONTH_JULY: 7,
MONTH_AUGUST: 8,
MONTH_SEPTEMBER: 9,
MONTH_OCTOBER: 10,
MONTH_NOVEMBER: 11,
MONTH_DECEMBER: 12,
}


Expand Down

0 comments on commit 2454807

Please sign in to comment.