From 24548072c667e95aee8d4a6fea1c5847d0a23cf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CCreeperSan=E2=80=9D?= Date: Tue, 12 Sep 2023 09:19:09 +0800 Subject: [PATCH] Change month field start from 1 instead of 0 --- README.md | 4 ++-- README_zh_CN.md | 4 ++-- ...ate_database_from_chinese_calendar_text.py | 24 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 8be0c73..ceb67fd 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/README_zh_CN.md b/README_zh_CN.md index 9636072..9e11196 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -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 | 农历年份的名称 | diff --git a/src/02_generate_database_from_chinese_calendar_text.py b/src/02_generate_database_from_chinese_calendar_text.py index 2e017b4..024b13e 100644 --- a/src/02_generate_database_from_chinese_calendar_text.py +++ b/src/02_generate_database_from_chinese_calendar_text.py @@ -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, }