From 87a6cfd06ac215cd6195884ff12ebc12217b61cc Mon Sep 17 00:00:00 2001 From: commenthol Date: Sat, 19 Jun 2021 21:09:37 +0200 Subject: [PATCH] feat(TW): new country Taiwan --- LICENSE | 1 + README.md | 3 +- data/countries/TW.todo | 54 ----- data/countries/TW.yaml | 270 ++++++++++++++++++++++ test/fixtures/TW-2015.json | 411 +++++++++++++++++++++++++++++++++ test/fixtures/TW-2016.json | 412 +++++++++++++++++++++++++++++++++ test/fixtures/TW-2017.json | 401 ++++++++++++++++++++++++++++++++ test/fixtures/TW-2018.json | 391 ++++++++++++++++++++++++++++++++ test/fixtures/TW-2019.json | 391 ++++++++++++++++++++++++++++++++ test/fixtures/TW-2020.json | 391 ++++++++++++++++++++++++++++++++ test/fixtures/TW-2021.json | 452 +++++++++++++++++++++++++++++++++++++ test/fixtures/TW-2022.json | 402 +++++++++++++++++++++++++++++++++ test/fixtures/TW-2023.json | 401 ++++++++++++++++++++++++++++++++ test/fixtures/TW-2024.json | 391 ++++++++++++++++++++++++++++++++ test/fixtures/TW-2025.json | 391 ++++++++++++++++++++++++++++++++ 15 files changed, 4707 insertions(+), 55 deletions(-) delete mode 100644 data/countries/TW.todo create mode 100644 data/countries/TW.yaml create mode 100644 test/fixtures/TW-2015.json create mode 100644 test/fixtures/TW-2016.json create mode 100644 test/fixtures/TW-2017.json create mode 100644 test/fixtures/TW-2018.json create mode 100644 test/fixtures/TW-2019.json create mode 100644 test/fixtures/TW-2020.json create mode 100644 test/fixtures/TW-2021.json create mode 100644 test/fixtures/TW-2022.json create mode 100644 test/fixtures/TW-2023.json create mode 100644 test/fixtures/TW-2024.json create mode 100644 test/fixtures/TW-2025.json diff --git a/LICENSE b/LICENSE index 3396df325..0c65d2168 100644 --- a/LICENSE +++ b/LICENSE @@ -111,6 +111,7 @@ https://en.wikipedia.org/wiki/Public_holidays_in_Slovenia https://en.wikipedia.org/wiki/Public_holidays_in_Somalia https://en.wikipedia.org/wiki/Public_holidays_in_South_Africa https://en.wikipedia.org/wiki/Public_holidays_in_South_Sudan +https://en.wikipedia.org/wiki/Public_holidays_in_Taiwan https://en.wikipedia.org/wiki/Public_holidays_in_Tanzania https://en.wikipedia.org/wiki/Public_holidays_in_Togo https://en.wikipedia.org/wiki/Public_holidays_in_Turkey diff --git a/README.md b/README.md index a055ea2b4..835845f7b 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ If you are missing holidays from your country, state, region please consider ``` -Countries: 164 +Countries: 165 ├── AD: Andorra │ └── 07: Andorra la Vella ├── AE: دولة الإمارات العربية المتحدة @@ -392,6 +392,7 @@ Countries: 164 ├── TN: الجمهورية التونسية ├── TO: Puleʻanga Fakatuʻi ʻo Tonga ├── TR: Türkiye +├── TW: 中華民國 ├── TZ: Tanzania ├── UA: Україна ├── UG: Uganda diff --git a/data/countries/TW.todo b/data/countries/TW.todo deleted file mode 100644 index 553254a3d..000000000 --- a/data/countries/TW.todo +++ /dev/null @@ -1,54 +0,0 @@ -holidays: - TW: - names: - en: Taiwan - langs: [] - zones: - - Asia/Taipei - dayoff: '' - days: {} - states: - CHA: - name: Changhua - CYI: - name: Chiayi County - CYQ: - name: Chiayi - HSQ: - name: Hsinchu County - HSZ: - name: Hsinchu - HUA: - name: Hualien - ILA: - name: Yilan - KEE: - name: Keelung - KHH: - name: Kaohsiung - KIN: - name: Kinmen - LIE: - name: Lienchiang - MIA: - name: Miaoli - NAN: - name: Nantou - NWT: - name: New Taipei - PEN: - name: Penghu - PIF: - name: Pingtung - TAO: - name: Taoyuan - TNN: - name: Tainan - TPE: - name: Taipei - TTT: - name: Taitung - TXG: - name: Taichung - YUN: - name: Yunlin diff --git a/data/countries/TW.yaml b/data/countries/TW.yaml new file mode 100644 index 000000000..e685567bb --- /dev/null +++ b/data/countries/TW.yaml @@ -0,0 +1,270 @@ +holidays: + TW: + # @attrib https://en.wikipedia.org/wiki/Public_holidays_in_Taiwan + names: + zh: 中華民國 + en: Taiwan + langs: + - zh + zones: + - Asia/Taipei + dayoff: '' + days: + 01-01 and if Saturday then previous Friday if Sunday then next Monday: + substitute: true + _name: 01-01 + name: + zh: 中華民國開國紀念日 / 元旦 + en: Founding of the Republic of China + chinese 01-0-00: + name: + en: Chinese New Year's Eve + zh: 農曆除夕 + chinese 01-0-01: + name: + en: Chinese New Year + zh: 農曆年初一 + chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday: + name: + en: Chinese New Year Holiday + zh: 农历新年假期 + chinese 01-0-02: + name: + en: The second day of the Chinese New Year + zh: 農曆年初二 + chinese 01-0-03: + name: + en: The third day of the Chinese New Year + zh: 農曆年初三 + chinese 01-0-04: + name: + en: The forth day of the Chinese New Year + zh: 農曆年初四 + 02-28 and if Sunday then next Monday: + substitute: true + name: + en: Peace Memorial Day + zh: 228和平紀念日 + 04-04 and if Sunday then next Monday: + substitute: true + name: + en: Children's Day + zh: 兒童節 + chinese 5-01 solarterm and if Sunday then next Monday: + substitute: true + name: + en: Tomb Sweeping Day + zh: 淸明節 + chinese 05-0-05 and if Sunday then next Monday: + substitute: true + name: + en: Dragon Boat Festival + zh: 端午節 + chinese 08-0-15 and if Sunday then next Monday: + substitute: true + name: + en: Mid-Autumn Festival + zh: 中秋節 + 10-10 and if Sunday then next Monday: + substitute: true + name: + en: National Day / Double Tenth Day + zh: 國慶日 / 雙十節 + # observed + 02-04: + name: + en: Farmer's Day + zh: 農民節 + type: observance + 03-08: + _name: 03-08 + type: observance + 03-12: + name: + en: Arbor Day + zh: 國父逝世紀念日 + type: observance + 03-29: + name: + en: Youth Day + zh: 靑年節 + type: observance + 05-01 and if Saturday then previous Friday if Sunday then next Monday: + substitute: true + _name: 05-01 + name: + zh: 勞動節 + type: observance + note: private sector + 05-04: + name: + en: Literary Day + zh: 文藝節 + type: observance + 2nd Sunday in May: + _name: Mothers Day + name: + zh: 母親節 + type: observance + 06-03: + name: + en: Opium Suppression Movement Day + zh: 禁菸節 + type: observance + 08-08: + _name: Fathers Day + name: + zh: 父親節 + type: observance + 09-01: + name: + en: Journalist' Day + zh: 記者節 + type: observance + 09-03: + name: + en: Armed Forces Day + zh: 軍人節 + type: observance + 09-28: + name: + en: Teachers' Day + zh: 孔子誕辰紀念日 + type: observance + 10-21: + name: + en: Overseas Chinese Day + zh: 華僑節 + type: observance + 10-25: + name: + en: Taiwan Retrocession Day + zh: 臺灣光復節 + type: observance + 11-12: + name: + en: Sun Yat-sen's Birthday + zh: 國父誕辰紀念日 + note: Also Doctors' Day and Cultural Renaissance Day + type: observance + december solstice: + name: + en: Dongzhi Festival + zh: 冬至 + type: observance + 12-25: + name: + en: Constitution Day + zh: 行憲紀念日 + type: observance + chinese 01-0-15: + name: + en: Lantern Festival + zh: 元宵節 + type: observance + 'chinese 01-0-15 #1': + name: + en: Tourism Day + zh: 觀光節 + type: observance + chinese 02-0-02: + name: + en: Earth God's Birthday + zh: 土地公誕辰 + type: observance + chinese 02-0-19: + name: + en: Kuan Yin's Birthday + zh: 觀音誕辰 + type: observance + chinese 03-0-15: + name: + en: God of Medicine's Birthday + zh: 保生大帝誕辰 + type: observance + chinese 03-0-23: + name: + en: Matsu's Birthday + zh: 媽祖誕辰 + type: observance + chinese 04-0-08: + name: + en: Buddha's Birthday + zh: 佛誕日 + type: observance + chinese 05-0-13: + name: + en: Kuan Kung's Birthday + zh: 關公誕辰 + type: observance + 'chinese 05-0-13 #1': + name: + en: Cheng Huang's Birthday + zh: 城隍爺誕辰 + type: observance + chinese 07-0-07: + name: + en: Qixi Festival + zh: 七夕 + type: observance + chinese 07-0-15: + name: + en: Ghost Festival + zh: 中元節 + type: observance + chinese 09-0-09: + name: + en: Double Ninth Festival + zh: 重陽節 + type: observance + chinese 10-0-15: + name: + en: Saisiat Festival + zh: 賽夏節 + type: observance + + # states: + # CHA: + # name: Changhua + # CYI: + # name: Chiayi County + # CYQ: + # name: Chiayi + # HSQ: + # name: Hsinchu County + # HSZ: + # name: Hsinchu + # HUA: + # name: Hualien + # ILA: + # name: Yilan + # KEE: + # name: Keelung + # KHH: + # name: Kaohsiung + # KIN: + # name: Kinmen + # LIE: + # name: Lienchiang + # MIA: + # name: Miaoli + # NAN: + # name: Nantou + # NWT: + # name: New Taipei + # PEN: + # name: Penghu + # PIF: + # name: Pingtung + # TAO: + # name: Taoyuan + # TNN: + # name: Tainan + # TPE: + # name: Taipei + # TTT: + # name: Taitung + # TXG: + # name: Taichung + # YUN: + # name: Yunlin diff --git a/test/fixtures/TW-2015.json b/test/fixtures/TW-2015.json new file mode 100644 index 000000000..d99c8aac0 --- /dev/null +++ b/test/fixtures/TW-2015.json @@ -0,0 +1,411 @@ +[ + { + "date": "2015-01-01 00:00:00", + "start": "2014-12-31T16:00:00.000Z", + "end": "2015-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2015-02-04 00:00:00", + "start": "2015-02-03T16:00:00.000Z", + "end": "2015-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Wed" + }, + { + "date": "2015-02-18 00:00:00", + "start": "2015-02-17T16:00:00.000Z", + "end": "2015-02-18T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Wed" + }, + { + "date": "2015-02-19 00:00:00", + "start": "2015-02-18T16:00:00.000Z", + "end": "2015-02-19T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Thu" + }, + { + "date": "2015-02-20 00:00:00", + "start": "2015-02-19T16:00:00.000Z", + "end": "2015-02-20T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Fri" + }, + { + "date": "2015-02-21 00:00:00", + "start": "2015-02-20T16:00:00.000Z", + "end": "2015-02-21T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Sat" + }, + { + "date": "2015-02-22 00:00:00", + "start": "2015-02-21T16:00:00.000Z", + "end": "2015-02-22T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Sun" + }, + { + "date": "2015-02-23 00:00:00", + "start": "2015-02-22T16:00:00.000Z", + "end": "2015-02-23T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Mon" + }, + { + "date": "2015-02-28 00:00:00", + "start": "2015-02-27T16:00:00.000Z", + "end": "2015-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2015-03-05 00:00:00", + "start": "2015-03-04T16:00:00.000Z", + "end": "2015-03-05T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Thu" + }, + { + "date": "2015-03-05 00:00:00", + "start": "2015-03-04T16:00:00.000Z", + "end": "2015-03-05T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Thu" + }, + { + "date": "2015-03-08 00:00:00", + "start": "2015-03-07T16:00:00.000Z", + "end": "2015-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Sun" + }, + { + "date": "2015-03-12 00:00:00", + "start": "2015-03-11T16:00:00.000Z", + "end": "2015-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Thu" + }, + { + "date": "2015-03-21 00:00:00", + "start": "2015-03-20T16:00:00.000Z", + "end": "2015-03-21T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Sat" + }, + { + "date": "2015-03-29 00:00:00", + "start": "2015-03-28T16:00:00.000Z", + "end": "2015-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Sun" + }, + { + "date": "2015-04-04 00:00:00", + "start": "2015-04-03T16:00:00.000Z", + "end": "2015-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2015-04-05 00:00:00", + "start": "2015-04-04T16:00:00.000Z", + "end": "2015-04-05T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2015-04-06 00:00:00", + "start": "2015-04-05T16:00:00.000Z", + "end": "2015-04-06T16:00:00.000Z", + "name": "淸明節 (substitute day)", + "type": "public", + "substitute": true, + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2015-04-07 00:00:00", + "start": "2015-04-06T16:00:00.000Z", + "end": "2015-04-07T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Tue" + }, + { + "date": "2015-05-01 00:00:00", + "start": "2015-04-30T16:00:00.000Z", + "end": "2015-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2015-05-03 00:00:00", + "start": "2015-05-02T16:00:00.000Z", + "end": "2015-05-03T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Sun" + }, + { + "date": "2015-05-04 00:00:00", + "start": "2015-05-03T16:00:00.000Z", + "end": "2015-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Mon" + }, + { + "date": "2015-05-10 00:00:00", + "start": "2015-05-09T16:00:00.000Z", + "end": "2015-05-10T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2015-05-11 00:00:00", + "start": "2015-05-10T16:00:00.000Z", + "end": "2015-05-11T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Mon" + }, + { + "date": "2015-05-25 00:00:00", + "start": "2015-05-24T16:00:00.000Z", + "end": "2015-05-25T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Mon" + }, + { + "date": "2015-06-03 00:00:00", + "start": "2015-06-02T16:00:00.000Z", + "end": "2015-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Wed" + }, + { + "date": "2015-06-20 00:00:00", + "start": "2015-06-19T16:00:00.000Z", + "end": "2015-06-20T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2015-06-28 00:00:00", + "start": "2015-06-27T16:00:00.000Z", + "end": "2015-06-28T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Sun" + }, + { + "date": "2015-06-28 00:00:00", + "start": "2015-06-27T16:00:00.000Z", + "end": "2015-06-28T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Sun" + }, + { + "date": "2015-08-08 00:00:00", + "start": "2015-08-07T16:00:00.000Z", + "end": "2015-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Sat" + }, + { + "date": "2015-08-20 00:00:00", + "start": "2015-08-19T16:00:00.000Z", + "end": "2015-08-20T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Thu" + }, + { + "date": "2015-08-28 00:00:00", + "start": "2015-08-27T16:00:00.000Z", + "end": "2015-08-28T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Fri" + }, + { + "date": "2015-09-01 00:00:00", + "start": "2015-08-31T16:00:00.000Z", + "end": "2015-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Tue" + }, + { + "date": "2015-09-03 00:00:00", + "start": "2015-09-02T16:00:00.000Z", + "end": "2015-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Thu" + }, + { + "date": "2015-09-27 00:00:00", + "start": "2015-09-26T16:00:00.000Z", + "end": "2015-09-27T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2015-09-28 00:00:00", + "start": "2015-09-27T16:00:00.000Z", + "end": "2015-09-28T16:00:00.000Z", + "name": "中秋節 (substitute day)", + "type": "public", + "substitute": true, + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2015-09-28 00:00:00", + "start": "2015-09-27T16:00:00.000Z", + "end": "2015-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Mon" + }, + { + "date": "2015-10-10 00:00:00", + "start": "2015-10-09T16:00:00.000Z", + "end": "2015-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2015-10-21 00:00:00", + "start": "2015-10-20T16:00:00.000Z", + "end": "2015-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Wed" + }, + { + "date": "2015-10-21 00:00:00", + "start": "2015-10-20T16:00:00.000Z", + "end": "2015-10-21T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Wed" + }, + { + "date": "2015-10-25 00:00:00", + "start": "2015-10-24T16:00:00.000Z", + "end": "2015-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Sun" + }, + { + "date": "2015-11-12 00:00:00", + "start": "2015-11-11T16:00:00.000Z", + "end": "2015-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Thu" + }, + { + "date": "2015-11-26 00:00:00", + "start": "2015-11-25T16:00:00.000Z", + "end": "2015-11-26T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Thu" + }, + { + "date": "2015-12-22 00:00:00", + "start": "2015-12-21T16:00:00.000Z", + "end": "2015-12-22T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Tue" + }, + { + "date": "2015-12-25 00:00:00", + "start": "2015-12-24T16:00:00.000Z", + "end": "2015-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Fri" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2016.json b/test/fixtures/TW-2016.json new file mode 100644 index 000000000..47a4a83ed --- /dev/null +++ b/test/fixtures/TW-2016.json @@ -0,0 +1,412 @@ +[ + { + "date": "2016-01-01 00:00:00", + "start": "2015-12-31T16:00:00.000Z", + "end": "2016-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2016-02-04 00:00:00", + "start": "2016-02-03T16:00:00.000Z", + "end": "2016-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Thu" + }, + { + "date": "2016-02-07 00:00:00", + "start": "2016-02-06T16:00:00.000Z", + "end": "2016-02-07T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Sun" + }, + { + "date": "2016-02-08 00:00:00", + "start": "2016-02-07T16:00:00.000Z", + "end": "2016-02-08T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Mon" + }, + { + "date": "2016-02-09 00:00:00", + "start": "2016-02-08T16:00:00.000Z", + "end": "2016-02-09T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Tue" + }, + { + "date": "2016-02-10 00:00:00", + "start": "2016-02-09T16:00:00.000Z", + "end": "2016-02-10T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Wed" + }, + { + "date": "2016-02-11 00:00:00", + "start": "2016-02-10T16:00:00.000Z", + "end": "2016-02-11T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Thu" + }, + { + "date": "2016-02-12 00:00:00", + "start": "2016-02-11T16:00:00.000Z", + "end": "2016-02-12T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Fri" + }, + { + "date": "2016-02-22 00:00:00", + "start": "2016-02-21T16:00:00.000Z", + "end": "2016-02-22T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Mon" + }, + { + "date": "2016-02-22 00:00:00", + "start": "2016-02-21T16:00:00.000Z", + "end": "2016-02-22T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Mon" + }, + { + "date": "2016-02-28 00:00:00", + "start": "2016-02-27T16:00:00.000Z", + "end": "2016-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2016-02-29 00:00:00", + "start": "2016-02-28T16:00:00.000Z", + "end": "2016-02-29T16:00:00.000Z", + "name": "228和平紀念日 (substitute day)", + "type": "public", + "substitute": true, + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2016-03-08 00:00:00", + "start": "2016-03-07T16:00:00.000Z", + "end": "2016-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Tue" + }, + { + "date": "2016-03-10 00:00:00", + "start": "2016-03-09T16:00:00.000Z", + "end": "2016-03-10T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Thu" + }, + { + "date": "2016-03-12 00:00:00", + "start": "2016-03-11T16:00:00.000Z", + "end": "2016-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Sat" + }, + { + "date": "2016-03-27 00:00:00", + "start": "2016-03-26T16:00:00.000Z", + "end": "2016-03-27T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Sun" + }, + { + "date": "2016-03-29 00:00:00", + "start": "2016-03-28T16:00:00.000Z", + "end": "2016-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Tue" + }, + { + "date": "2016-04-04 00:00:00", + "start": "2016-04-03T16:00:00.000Z", + "end": "2016-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2016-04-04 00:00:00", + "start": "2016-04-03T16:00:00.000Z", + "end": "2016-04-04T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2016-04-21 00:00:00", + "start": "2016-04-20T16:00:00.000Z", + "end": "2016-04-21T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Thu" + }, + { + "date": "2016-04-29 00:00:00", + "start": "2016-04-28T16:00:00.000Z", + "end": "2016-04-29T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Fri" + }, + { + "date": "2016-05-01 00:00:00", + "start": "2016-04-30T16:00:00.000Z", + "end": "2016-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2016-05-02 00:00:00", + "start": "2016-05-01T16:00:00.000Z", + "end": "2016-05-02T16:00:00.000Z", + "name": "勞動節 (substitute day)", + "type": "observance", + "note": "private sector", + "substitute": true, + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2016-05-04 00:00:00", + "start": "2016-05-03T16:00:00.000Z", + "end": "2016-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Wed" + }, + { + "date": "2016-05-08 00:00:00", + "start": "2016-05-07T16:00:00.000Z", + "end": "2016-05-08T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2016-05-14 00:00:00", + "start": "2016-05-13T16:00:00.000Z", + "end": "2016-05-14T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Sat" + }, + { + "date": "2016-06-03 00:00:00", + "start": "2016-06-02T16:00:00.000Z", + "end": "2016-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Fri" + }, + { + "date": "2016-06-09 00:00:00", + "start": "2016-06-08T16:00:00.000Z", + "end": "2016-06-09T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2016-06-17 00:00:00", + "start": "2016-06-16T16:00:00.000Z", + "end": "2016-06-17T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Fri" + }, + { + "date": "2016-06-17 00:00:00", + "start": "2016-06-16T16:00:00.000Z", + "end": "2016-06-17T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Fri" + }, + { + "date": "2016-08-08 00:00:00", + "start": "2016-08-07T16:00:00.000Z", + "end": "2016-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Mon" + }, + { + "date": "2016-08-09 00:00:00", + "start": "2016-08-08T16:00:00.000Z", + "end": "2016-08-09T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Tue" + }, + { + "date": "2016-08-17 00:00:00", + "start": "2016-08-16T16:00:00.000Z", + "end": "2016-08-17T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Wed" + }, + { + "date": "2016-09-01 00:00:00", + "start": "2016-08-31T16:00:00.000Z", + "end": "2016-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Thu" + }, + { + "date": "2016-09-03 00:00:00", + "start": "2016-09-02T16:00:00.000Z", + "end": "2016-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Sat" + }, + { + "date": "2016-09-15 00:00:00", + "start": "2016-09-14T16:00:00.000Z", + "end": "2016-09-15T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2016-09-28 00:00:00", + "start": "2016-09-27T16:00:00.000Z", + "end": "2016-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Wed" + }, + { + "date": "2016-10-09 00:00:00", + "start": "2016-10-08T16:00:00.000Z", + "end": "2016-10-09T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Sun" + }, + { + "date": "2016-10-10 00:00:00", + "start": "2016-10-09T16:00:00.000Z", + "end": "2016-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2016-10-21 00:00:00", + "start": "2016-10-20T16:00:00.000Z", + "end": "2016-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Fri" + }, + { + "date": "2016-10-25 00:00:00", + "start": "2016-10-24T16:00:00.000Z", + "end": "2016-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Tue" + }, + { + "date": "2016-11-12 00:00:00", + "start": "2016-11-11T16:00:00.000Z", + "end": "2016-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Sat" + }, + { + "date": "2016-11-14 00:00:00", + "start": "2016-11-13T16:00:00.000Z", + "end": "2016-11-14T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Mon" + }, + { + "date": "2016-12-21 00:00:00", + "start": "2016-12-20T16:00:00.000Z", + "end": "2016-12-21T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Wed" + }, + { + "date": "2016-12-25 00:00:00", + "start": "2016-12-24T16:00:00.000Z", + "end": "2016-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Sun" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2017.json b/test/fixtures/TW-2017.json new file mode 100644 index 000000000..1625b6c8a --- /dev/null +++ b/test/fixtures/TW-2017.json @@ -0,0 +1,401 @@ +[ + { + "date": "2017-01-01 00:00:00", + "start": "2016-12-31T16:00:00.000Z", + "end": "2017-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2017-01-02 00:00:00", + "start": "2017-01-01T16:00:00.000Z", + "end": "2017-01-02T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦 (substitute day)", + "type": "public", + "substitute": true, + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2017-01-27 00:00:00", + "start": "2017-01-26T16:00:00.000Z", + "end": "2017-01-27T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Fri" + }, + { + "date": "2017-01-28 00:00:00", + "start": "2017-01-27T16:00:00.000Z", + "end": "2017-01-28T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Sat" + }, + { + "date": "2017-01-29 00:00:00", + "start": "2017-01-28T16:00:00.000Z", + "end": "2017-01-29T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Sun" + }, + { + "date": "2017-01-30 00:00:00", + "start": "2017-01-29T16:00:00.000Z", + "end": "2017-01-30T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Mon" + }, + { + "date": "2017-01-31 00:00:00", + "start": "2017-01-30T16:00:00.000Z", + "end": "2017-01-31T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Tue" + }, + { + "date": "2017-02-01 00:00:00", + "start": "2017-01-31T16:00:00.000Z", + "end": "2017-02-01T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Wed" + }, + { + "date": "2017-02-04 00:00:00", + "start": "2017-02-03T16:00:00.000Z", + "end": "2017-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Sat" + }, + { + "date": "2017-02-11 00:00:00", + "start": "2017-02-10T16:00:00.000Z", + "end": "2017-02-11T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Sat" + }, + { + "date": "2017-02-11 00:00:00", + "start": "2017-02-10T16:00:00.000Z", + "end": "2017-02-11T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Sat" + }, + { + "date": "2017-02-27 00:00:00", + "start": "2017-02-26T16:00:00.000Z", + "end": "2017-02-27T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Mon" + }, + { + "date": "2017-02-28 00:00:00", + "start": "2017-02-27T16:00:00.000Z", + "end": "2017-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2017-03-08 00:00:00", + "start": "2017-03-07T16:00:00.000Z", + "end": "2017-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Wed" + }, + { + "date": "2017-03-12 00:00:00", + "start": "2017-03-11T16:00:00.000Z", + "end": "2017-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Sun" + }, + { + "date": "2017-03-16 00:00:00", + "start": "2017-03-15T16:00:00.000Z", + "end": "2017-03-16T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Thu" + }, + { + "date": "2017-03-29 00:00:00", + "start": "2017-03-28T16:00:00.000Z", + "end": "2017-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Wed" + }, + { + "date": "2017-04-04 00:00:00", + "start": "2017-04-03T16:00:00.000Z", + "end": "2017-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2017-04-04 00:00:00", + "start": "2017-04-03T16:00:00.000Z", + "end": "2017-04-04T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2017-04-11 00:00:00", + "start": "2017-04-10T16:00:00.000Z", + "end": "2017-04-11T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Tue" + }, + { + "date": "2017-04-19 00:00:00", + "start": "2017-04-18T16:00:00.000Z", + "end": "2017-04-19T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Wed" + }, + { + "date": "2017-05-01 00:00:00", + "start": "2017-04-30T16:00:00.000Z", + "end": "2017-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2017-05-03 00:00:00", + "start": "2017-05-02T16:00:00.000Z", + "end": "2017-05-03T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Wed" + }, + { + "date": "2017-05-04 00:00:00", + "start": "2017-05-03T16:00:00.000Z", + "end": "2017-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Thu" + }, + { + "date": "2017-05-14 00:00:00", + "start": "2017-05-13T16:00:00.000Z", + "end": "2017-05-14T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2017-05-30 00:00:00", + "start": "2017-05-29T16:00:00.000Z", + "end": "2017-05-30T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2017-06-03 00:00:00", + "start": "2017-06-02T16:00:00.000Z", + "end": "2017-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Sat" + }, + { + "date": "2017-06-07 00:00:00", + "start": "2017-06-06T16:00:00.000Z", + "end": "2017-06-07T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Wed" + }, + { + "date": "2017-06-07 00:00:00", + "start": "2017-06-06T16:00:00.000Z", + "end": "2017-06-07T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Wed" + }, + { + "date": "2017-08-08 00:00:00", + "start": "2017-08-07T16:00:00.000Z", + "end": "2017-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Tue" + }, + { + "date": "2017-08-28 00:00:00", + "start": "2017-08-27T16:00:00.000Z", + "end": "2017-08-28T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Mon" + }, + { + "date": "2017-09-01 00:00:00", + "start": "2017-08-31T16:00:00.000Z", + "end": "2017-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Fri" + }, + { + "date": "2017-09-03 00:00:00", + "start": "2017-09-02T16:00:00.000Z", + "end": "2017-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Sun" + }, + { + "date": "2017-09-05 00:00:00", + "start": "2017-09-04T16:00:00.000Z", + "end": "2017-09-05T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Tue" + }, + { + "date": "2017-09-28 00:00:00", + "start": "2017-09-27T16:00:00.000Z", + "end": "2017-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Thu" + }, + { + "date": "2017-10-04 00:00:00", + "start": "2017-10-03T16:00:00.000Z", + "end": "2017-10-04T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2017-10-10 00:00:00", + "start": "2017-10-09T16:00:00.000Z", + "end": "2017-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2017-10-21 00:00:00", + "start": "2017-10-20T16:00:00.000Z", + "end": "2017-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Sat" + }, + { + "date": "2017-10-25 00:00:00", + "start": "2017-10-24T16:00:00.000Z", + "end": "2017-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Wed" + }, + { + "date": "2017-10-28 00:00:00", + "start": "2017-10-27T16:00:00.000Z", + "end": "2017-10-28T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Sat" + }, + { + "date": "2017-11-12 00:00:00", + "start": "2017-11-11T16:00:00.000Z", + "end": "2017-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Sun" + }, + { + "date": "2017-12-02 00:00:00", + "start": "2017-12-01T16:00:00.000Z", + "end": "2017-12-02T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Sat" + }, + { + "date": "2017-12-21 00:00:00", + "start": "2017-12-20T16:00:00.000Z", + "end": "2017-12-21T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Thu" + }, + { + "date": "2017-12-25 00:00:00", + "start": "2017-12-24T16:00:00.000Z", + "end": "2017-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Mon" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2018.json b/test/fixtures/TW-2018.json new file mode 100644 index 000000000..a37de433a --- /dev/null +++ b/test/fixtures/TW-2018.json @@ -0,0 +1,391 @@ +[ + { + "date": "2018-01-01 00:00:00", + "start": "2017-12-31T16:00:00.000Z", + "end": "2018-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2018-02-04 00:00:00", + "start": "2018-02-03T16:00:00.000Z", + "end": "2018-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Sun" + }, + { + "date": "2018-02-15 00:00:00", + "start": "2018-02-14T16:00:00.000Z", + "end": "2018-02-15T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Thu" + }, + { + "date": "2018-02-16 00:00:00", + "start": "2018-02-15T16:00:00.000Z", + "end": "2018-02-16T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Fri" + }, + { + "date": "2018-02-17 00:00:00", + "start": "2018-02-16T16:00:00.000Z", + "end": "2018-02-17T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Sat" + }, + { + "date": "2018-02-18 00:00:00", + "start": "2018-02-17T16:00:00.000Z", + "end": "2018-02-18T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Sun" + }, + { + "date": "2018-02-19 00:00:00", + "start": "2018-02-18T16:00:00.000Z", + "end": "2018-02-19T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Mon" + }, + { + "date": "2018-02-20 00:00:00", + "start": "2018-02-19T16:00:00.000Z", + "end": "2018-02-20T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Tue" + }, + { + "date": "2018-02-28 00:00:00", + "start": "2018-02-27T16:00:00.000Z", + "end": "2018-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2018-03-02 00:00:00", + "start": "2018-03-01T16:00:00.000Z", + "end": "2018-03-02T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Fri" + }, + { + "date": "2018-03-02 00:00:00", + "start": "2018-03-01T16:00:00.000Z", + "end": "2018-03-02T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Fri" + }, + { + "date": "2018-03-08 00:00:00", + "start": "2018-03-07T16:00:00.000Z", + "end": "2018-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Thu" + }, + { + "date": "2018-03-12 00:00:00", + "start": "2018-03-11T16:00:00.000Z", + "end": "2018-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Mon" + }, + { + "date": "2018-03-18 00:00:00", + "start": "2018-03-17T16:00:00.000Z", + "end": "2018-03-18T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Sun" + }, + { + "date": "2018-03-29 00:00:00", + "start": "2018-03-28T16:00:00.000Z", + "end": "2018-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Thu" + }, + { + "date": "2018-04-04 00:00:00", + "start": "2018-04-03T16:00:00.000Z", + "end": "2018-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2018-04-04 00:00:00", + "start": "2018-04-03T16:00:00.000Z", + "end": "2018-04-04T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Wed" + }, + { + "date": "2018-04-05 00:00:00", + "start": "2018-04-04T16:00:00.000Z", + "end": "2018-04-05T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2018-04-30 00:00:00", + "start": "2018-04-29T16:00:00.000Z", + "end": "2018-04-30T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Mon" + }, + { + "date": "2018-05-01 00:00:00", + "start": "2018-04-30T16:00:00.000Z", + "end": "2018-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2018-05-04 00:00:00", + "start": "2018-05-03T16:00:00.000Z", + "end": "2018-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Fri" + }, + { + "date": "2018-05-08 00:00:00", + "start": "2018-05-07T16:00:00.000Z", + "end": "2018-05-08T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Tue" + }, + { + "date": "2018-05-13 00:00:00", + "start": "2018-05-12T16:00:00.000Z", + "end": "2018-05-13T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2018-05-22 00:00:00", + "start": "2018-05-21T16:00:00.000Z", + "end": "2018-05-22T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Tue" + }, + { + "date": "2018-06-03 00:00:00", + "start": "2018-06-02T16:00:00.000Z", + "end": "2018-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Sun" + }, + { + "date": "2018-06-18 00:00:00", + "start": "2018-06-17T16:00:00.000Z", + "end": "2018-06-18T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2018-06-26 00:00:00", + "start": "2018-06-25T16:00:00.000Z", + "end": "2018-06-26T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Tue" + }, + { + "date": "2018-06-26 00:00:00", + "start": "2018-06-25T16:00:00.000Z", + "end": "2018-06-26T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Tue" + }, + { + "date": "2018-08-08 00:00:00", + "start": "2018-08-07T16:00:00.000Z", + "end": "2018-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Wed" + }, + { + "date": "2018-08-17 00:00:00", + "start": "2018-08-16T16:00:00.000Z", + "end": "2018-08-17T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Fri" + }, + { + "date": "2018-08-25 00:00:00", + "start": "2018-08-24T16:00:00.000Z", + "end": "2018-08-25T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Sat" + }, + { + "date": "2018-09-01 00:00:00", + "start": "2018-08-31T16:00:00.000Z", + "end": "2018-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Sat" + }, + { + "date": "2018-09-03 00:00:00", + "start": "2018-09-02T16:00:00.000Z", + "end": "2018-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Mon" + }, + { + "date": "2018-09-24 00:00:00", + "start": "2018-09-23T16:00:00.000Z", + "end": "2018-09-24T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2018-09-28 00:00:00", + "start": "2018-09-27T16:00:00.000Z", + "end": "2018-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Fri" + }, + { + "date": "2018-10-10 00:00:00", + "start": "2018-10-09T16:00:00.000Z", + "end": "2018-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2018-10-17 00:00:00", + "start": "2018-10-16T16:00:00.000Z", + "end": "2018-10-17T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Wed" + }, + { + "date": "2018-10-21 00:00:00", + "start": "2018-10-20T16:00:00.000Z", + "end": "2018-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Sun" + }, + { + "date": "2018-10-25 00:00:00", + "start": "2018-10-24T16:00:00.000Z", + "end": "2018-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Thu" + }, + { + "date": "2018-11-12 00:00:00", + "start": "2018-11-11T16:00:00.000Z", + "end": "2018-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Mon" + }, + { + "date": "2018-11-22 00:00:00", + "start": "2018-11-21T16:00:00.000Z", + "end": "2018-11-22T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Thu" + }, + { + "date": "2018-12-21 00:00:00", + "start": "2018-12-20T16:00:00.000Z", + "end": "2018-12-21T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Fri" + }, + { + "date": "2018-12-25 00:00:00", + "start": "2018-12-24T16:00:00.000Z", + "end": "2018-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Tue" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2019.json b/test/fixtures/TW-2019.json new file mode 100644 index 000000000..3c94a1a5c --- /dev/null +++ b/test/fixtures/TW-2019.json @@ -0,0 +1,391 @@ +[ + { + "date": "2019-01-01 00:00:00", + "start": "2018-12-31T16:00:00.000Z", + "end": "2019-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2019-02-04 00:00:00", + "start": "2019-02-03T16:00:00.000Z", + "end": "2019-02-04T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Mon" + }, + { + "date": "2019-02-04 00:00:00", + "start": "2019-02-03T16:00:00.000Z", + "end": "2019-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Mon" + }, + { + "date": "2019-02-05 00:00:00", + "start": "2019-02-04T16:00:00.000Z", + "end": "2019-02-05T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Tue" + }, + { + "date": "2019-02-06 00:00:00", + "start": "2019-02-05T16:00:00.000Z", + "end": "2019-02-06T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Wed" + }, + { + "date": "2019-02-07 00:00:00", + "start": "2019-02-06T16:00:00.000Z", + "end": "2019-02-07T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Thu" + }, + { + "date": "2019-02-08 00:00:00", + "start": "2019-02-07T16:00:00.000Z", + "end": "2019-02-08T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Fri" + }, + { + "date": "2019-02-09 00:00:00", + "start": "2019-02-08T16:00:00.000Z", + "end": "2019-02-09T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Sat" + }, + { + "date": "2019-02-19 00:00:00", + "start": "2019-02-18T16:00:00.000Z", + "end": "2019-02-19T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Tue" + }, + { + "date": "2019-02-19 00:00:00", + "start": "2019-02-18T16:00:00.000Z", + "end": "2019-02-19T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Tue" + }, + { + "date": "2019-02-28 00:00:00", + "start": "2019-02-27T16:00:00.000Z", + "end": "2019-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2019-03-08 00:00:00", + "start": "2019-03-07T16:00:00.000Z", + "end": "2019-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Fri" + }, + { + "date": "2019-03-08 00:00:00", + "start": "2019-03-07T16:00:00.000Z", + "end": "2019-03-08T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Fri" + }, + { + "date": "2019-03-12 00:00:00", + "start": "2019-03-11T16:00:00.000Z", + "end": "2019-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Tue" + }, + { + "date": "2019-03-25 00:00:00", + "start": "2019-03-24T16:00:00.000Z", + "end": "2019-03-25T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Mon" + }, + { + "date": "2019-03-29 00:00:00", + "start": "2019-03-28T16:00:00.000Z", + "end": "2019-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Fri" + }, + { + "date": "2019-04-04 00:00:00", + "start": "2019-04-03T16:00:00.000Z", + "end": "2019-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2019-04-05 00:00:00", + "start": "2019-04-04T16:00:00.000Z", + "end": "2019-04-05T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2019-04-19 00:00:00", + "start": "2019-04-18T16:00:00.000Z", + "end": "2019-04-19T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Fri" + }, + { + "date": "2019-04-27 00:00:00", + "start": "2019-04-26T16:00:00.000Z", + "end": "2019-04-27T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Sat" + }, + { + "date": "2019-05-01 00:00:00", + "start": "2019-04-30T16:00:00.000Z", + "end": "2019-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2019-05-04 00:00:00", + "start": "2019-05-03T16:00:00.000Z", + "end": "2019-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Sat" + }, + { + "date": "2019-05-12 00:00:00", + "start": "2019-05-11T16:00:00.000Z", + "end": "2019-05-12T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Sun" + }, + { + "date": "2019-05-12 00:00:00", + "start": "2019-05-11T16:00:00.000Z", + "end": "2019-05-12T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2019-06-03 00:00:00", + "start": "2019-06-02T16:00:00.000Z", + "end": "2019-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Mon" + }, + { + "date": "2019-06-07 00:00:00", + "start": "2019-06-06T16:00:00.000Z", + "end": "2019-06-07T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2019-06-15 00:00:00", + "start": "2019-06-14T16:00:00.000Z", + "end": "2019-06-15T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Sat" + }, + { + "date": "2019-06-15 00:00:00", + "start": "2019-06-14T16:00:00.000Z", + "end": "2019-06-15T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Sat" + }, + { + "date": "2019-08-07 00:00:00", + "start": "2019-08-06T16:00:00.000Z", + "end": "2019-08-07T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Wed" + }, + { + "date": "2019-08-08 00:00:00", + "start": "2019-08-07T16:00:00.000Z", + "end": "2019-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Thu" + }, + { + "date": "2019-08-15 00:00:00", + "start": "2019-08-14T16:00:00.000Z", + "end": "2019-08-15T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Thu" + }, + { + "date": "2019-09-01 00:00:00", + "start": "2019-08-31T16:00:00.000Z", + "end": "2019-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Sun" + }, + { + "date": "2019-09-03 00:00:00", + "start": "2019-09-02T16:00:00.000Z", + "end": "2019-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Tue" + }, + { + "date": "2019-09-13 00:00:00", + "start": "2019-09-12T16:00:00.000Z", + "end": "2019-09-13T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2019-09-28 00:00:00", + "start": "2019-09-27T16:00:00.000Z", + "end": "2019-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Sat" + }, + { + "date": "2019-10-07 00:00:00", + "start": "2019-10-06T16:00:00.000Z", + "end": "2019-10-07T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Mon" + }, + { + "date": "2019-10-10 00:00:00", + "start": "2019-10-09T16:00:00.000Z", + "end": "2019-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2019-10-21 00:00:00", + "start": "2019-10-20T16:00:00.000Z", + "end": "2019-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Mon" + }, + { + "date": "2019-10-25 00:00:00", + "start": "2019-10-24T16:00:00.000Z", + "end": "2019-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Fri" + }, + { + "date": "2019-11-11 00:00:00", + "start": "2019-11-10T16:00:00.000Z", + "end": "2019-11-11T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Mon" + }, + { + "date": "2019-11-12 00:00:00", + "start": "2019-11-11T16:00:00.000Z", + "end": "2019-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Tue" + }, + { + "date": "2019-12-22 00:00:00", + "start": "2019-12-21T16:00:00.000Z", + "end": "2019-12-22T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Sun" + }, + { + "date": "2019-12-25 00:00:00", + "start": "2019-12-24T16:00:00.000Z", + "end": "2019-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Wed" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2020.json b/test/fixtures/TW-2020.json new file mode 100644 index 000000000..117e030cf --- /dev/null +++ b/test/fixtures/TW-2020.json @@ -0,0 +1,391 @@ +[ + { + "date": "2020-01-01 00:00:00", + "start": "2019-12-31T16:00:00.000Z", + "end": "2020-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2020-01-24 00:00:00", + "start": "2020-01-23T16:00:00.000Z", + "end": "2020-01-24T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Fri" + }, + { + "date": "2020-01-25 00:00:00", + "start": "2020-01-24T16:00:00.000Z", + "end": "2020-01-25T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Sat" + }, + { + "date": "2020-01-26 00:00:00", + "start": "2020-01-25T16:00:00.000Z", + "end": "2020-01-26T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Sun" + }, + { + "date": "2020-01-27 00:00:00", + "start": "2020-01-26T16:00:00.000Z", + "end": "2020-01-27T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Mon" + }, + { + "date": "2020-01-28 00:00:00", + "start": "2020-01-27T16:00:00.000Z", + "end": "2020-01-28T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Tue" + }, + { + "date": "2020-01-29 00:00:00", + "start": "2020-01-28T16:00:00.000Z", + "end": "2020-01-29T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Wed" + }, + { + "date": "2020-02-04 00:00:00", + "start": "2020-02-03T16:00:00.000Z", + "end": "2020-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Tue" + }, + { + "date": "2020-02-08 00:00:00", + "start": "2020-02-07T16:00:00.000Z", + "end": "2020-02-08T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Sat" + }, + { + "date": "2020-02-08 00:00:00", + "start": "2020-02-07T16:00:00.000Z", + "end": "2020-02-08T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Sat" + }, + { + "date": "2020-02-24 00:00:00", + "start": "2020-02-23T16:00:00.000Z", + "end": "2020-02-24T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Mon" + }, + { + "date": "2020-02-28 00:00:00", + "start": "2020-02-27T16:00:00.000Z", + "end": "2020-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2020-03-08 00:00:00", + "start": "2020-03-07T16:00:00.000Z", + "end": "2020-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Sun" + }, + { + "date": "2020-03-12 00:00:00", + "start": "2020-03-11T16:00:00.000Z", + "end": "2020-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Thu" + }, + { + "date": "2020-03-12 00:00:00", + "start": "2020-03-11T16:00:00.000Z", + "end": "2020-03-12T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Thu" + }, + { + "date": "2020-03-29 00:00:00", + "start": "2020-03-28T16:00:00.000Z", + "end": "2020-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Sun" + }, + { + "date": "2020-04-04 00:00:00", + "start": "2020-04-03T16:00:00.000Z", + "end": "2020-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2020-04-04 00:00:00", + "start": "2020-04-03T16:00:00.000Z", + "end": "2020-04-04T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2020-04-07 00:00:00", + "start": "2020-04-06T16:00:00.000Z", + "end": "2020-04-07T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Tue" + }, + { + "date": "2020-04-15 00:00:00", + "start": "2020-04-14T16:00:00.000Z", + "end": "2020-04-15T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Wed" + }, + { + "date": "2020-04-30 00:00:00", + "start": "2020-04-29T16:00:00.000Z", + "end": "2020-04-30T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Thu" + }, + { + "date": "2020-05-01 00:00:00", + "start": "2020-04-30T16:00:00.000Z", + "end": "2020-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2020-05-04 00:00:00", + "start": "2020-05-03T16:00:00.000Z", + "end": "2020-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Mon" + }, + { + "date": "2020-05-10 00:00:00", + "start": "2020-05-09T16:00:00.000Z", + "end": "2020-05-10T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2020-06-03 00:00:00", + "start": "2020-06-02T16:00:00.000Z", + "end": "2020-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Wed" + }, + { + "date": "2020-06-25 00:00:00", + "start": "2020-06-24T16:00:00.000Z", + "end": "2020-06-25T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2020-07-03 00:00:00", + "start": "2020-07-02T16:00:00.000Z", + "end": "2020-07-03T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Fri" + }, + { + "date": "2020-07-03 00:00:00", + "start": "2020-07-02T16:00:00.000Z", + "end": "2020-07-03T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Fri" + }, + { + "date": "2020-08-08 00:00:00", + "start": "2020-08-07T16:00:00.000Z", + "end": "2020-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Sat" + }, + { + "date": "2020-08-25 00:00:00", + "start": "2020-08-24T16:00:00.000Z", + "end": "2020-08-25T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Tue" + }, + { + "date": "2020-09-01 00:00:00", + "start": "2020-08-31T16:00:00.000Z", + "end": "2020-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Tue" + }, + { + "date": "2020-09-02 00:00:00", + "start": "2020-09-01T16:00:00.000Z", + "end": "2020-09-02T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Wed" + }, + { + "date": "2020-09-03 00:00:00", + "start": "2020-09-02T16:00:00.000Z", + "end": "2020-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Thu" + }, + { + "date": "2020-09-28 00:00:00", + "start": "2020-09-27T16:00:00.000Z", + "end": "2020-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Mon" + }, + { + "date": "2020-10-01 00:00:00", + "start": "2020-09-30T16:00:00.000Z", + "end": "2020-10-01T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2020-10-10 00:00:00", + "start": "2020-10-09T16:00:00.000Z", + "end": "2020-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2020-10-21 00:00:00", + "start": "2020-10-20T16:00:00.000Z", + "end": "2020-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Wed" + }, + { + "date": "2020-10-25 00:00:00", + "start": "2020-10-24T16:00:00.000Z", + "end": "2020-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Sun" + }, + { + "date": "2020-10-25 00:00:00", + "start": "2020-10-24T16:00:00.000Z", + "end": "2020-10-25T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Sun" + }, + { + "date": "2020-11-12 00:00:00", + "start": "2020-11-11T16:00:00.000Z", + "end": "2020-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Thu" + }, + { + "date": "2020-11-29 00:00:00", + "start": "2020-11-28T16:00:00.000Z", + "end": "2020-11-29T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Sun" + }, + { + "date": "2020-12-21 00:00:00", + "start": "2020-12-20T16:00:00.000Z", + "end": "2020-12-21T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Mon" + }, + { + "date": "2020-12-25 00:00:00", + "start": "2020-12-24T16:00:00.000Z", + "end": "2020-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Fri" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2021.json b/test/fixtures/TW-2021.json new file mode 100644 index 000000000..fad71342c --- /dev/null +++ b/test/fixtures/TW-2021.json @@ -0,0 +1,452 @@ +[ + { + "date": "2021-01-01 00:00:00", + "start": "2020-12-31T16:00:00.000Z", + "end": "2021-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2021-02-04 00:00:00", + "start": "2021-02-03T16:00:00.000Z", + "end": "2021-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Thu" + }, + { + "date": "2021-02-11 00:00:00", + "start": "2021-02-10T16:00:00.000Z", + "end": "2021-02-11T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Thu" + }, + { + "date": "2021-02-12 00:00:00", + "start": "2021-02-11T16:00:00.000Z", + "end": "2021-02-12T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Fri" + }, + { + "date": "2021-02-13 00:00:00", + "start": "2021-02-12T16:00:00.000Z", + "end": "2021-02-13T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Sat" + }, + { + "date": "2021-02-14 00:00:00", + "start": "2021-02-13T16:00:00.000Z", + "end": "2021-02-14T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Sun" + }, + { + "date": "2021-02-15 00:00:00", + "start": "2021-02-14T16:00:00.000Z", + "end": "2021-02-15T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Mon" + }, + { + "date": "2021-02-16 00:00:00", + "start": "2021-02-15T16:00:00.000Z", + "end": "2021-02-16T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Tue" + }, + { + "date": "2021-02-26 00:00:00", + "start": "2021-02-25T16:00:00.000Z", + "end": "2021-02-26T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Fri" + }, + { + "date": "2021-02-26 00:00:00", + "start": "2021-02-25T16:00:00.000Z", + "end": "2021-02-26T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Fri" + }, + { + "date": "2021-02-28 00:00:00", + "start": "2021-02-27T16:00:00.000Z", + "end": "2021-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2021-03-01 00:00:00", + "start": "2021-02-28T16:00:00.000Z", + "end": "2021-03-01T16:00:00.000Z", + "name": "228和平紀念日 (substitute day)", + "type": "public", + "substitute": true, + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2021-03-08 00:00:00", + "start": "2021-03-07T16:00:00.000Z", + "end": "2021-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Mon" + }, + { + "date": "2021-03-12 00:00:00", + "start": "2021-03-11T16:00:00.000Z", + "end": "2021-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Fri" + }, + { + "date": "2021-03-14 00:00:00", + "start": "2021-03-13T16:00:00.000Z", + "end": "2021-03-14T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Sun" + }, + { + "date": "2021-03-29 00:00:00", + "start": "2021-03-28T16:00:00.000Z", + "end": "2021-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Mon" + }, + { + "date": "2021-03-31 00:00:00", + "start": "2021-03-30T16:00:00.000Z", + "end": "2021-03-31T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Wed" + }, + { + "date": "2021-04-04 00:00:00", + "start": "2021-04-03T16:00:00.000Z", + "end": "2021-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2021-04-04 00:00:00", + "start": "2021-04-03T16:00:00.000Z", + "end": "2021-04-04T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2021-04-05 00:00:00", + "start": "2021-04-04T16:00:00.000Z", + "end": "2021-04-05T16:00:00.000Z", + "name": "兒童節 (substitute day)", + "type": "public", + "substitute": true, + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2021-04-05 00:00:00", + "start": "2021-04-04T16:00:00.000Z", + "end": "2021-04-05T16:00:00.000Z", + "name": "淸明節 (substitute day)", + "type": "public", + "substitute": true, + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2021-04-26 00:00:00", + "start": "2021-04-25T16:00:00.000Z", + "end": "2021-04-26T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Mon" + }, + { + "date": "2021-04-30 00:00:00", + "start": "2021-04-29T16:00:00.000Z", + "end": "2021-04-30T16:00:00.000Z", + "name": "勞動節 (substitute day)", + "type": "observance", + "note": "private sector", + "substitute": true, + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2021-05-01 00:00:00", + "start": "2021-04-30T16:00:00.000Z", + "end": "2021-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2021-05-04 00:00:00", + "start": "2021-05-03T16:00:00.000Z", + "end": "2021-05-04T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Tue" + }, + { + "date": "2021-05-04 00:00:00", + "start": "2021-05-03T16:00:00.000Z", + "end": "2021-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Tue" + }, + { + "date": "2021-05-09 00:00:00", + "start": "2021-05-08T16:00:00.000Z", + "end": "2021-05-09T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2021-05-19 00:00:00", + "start": "2021-05-18T16:00:00.000Z", + "end": "2021-05-19T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Wed" + }, + { + "date": "2021-06-03 00:00:00", + "start": "2021-06-02T16:00:00.000Z", + "end": "2021-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Thu" + }, + { + "date": "2021-06-14 00:00:00", + "start": "2021-06-13T16:00:00.000Z", + "end": "2021-06-14T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2021-06-22 00:00:00", + "start": "2021-06-21T16:00:00.000Z", + "end": "2021-06-22T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Tue" + }, + { + "date": "2021-06-22 00:00:00", + "start": "2021-06-21T16:00:00.000Z", + "end": "2021-06-22T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Tue" + }, + { + "date": "2021-08-08 00:00:00", + "start": "2021-08-07T16:00:00.000Z", + "end": "2021-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Sun" + }, + { + "date": "2021-08-14 00:00:00", + "start": "2021-08-13T16:00:00.000Z", + "end": "2021-08-14T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Sat" + }, + { + "date": "2021-08-22 00:00:00", + "start": "2021-08-21T16:00:00.000Z", + "end": "2021-08-22T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Sun" + }, + { + "date": "2021-09-01 00:00:00", + "start": "2021-08-31T16:00:00.000Z", + "end": "2021-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Wed" + }, + { + "date": "2021-09-03 00:00:00", + "start": "2021-09-02T16:00:00.000Z", + "end": "2021-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Fri" + }, + { + "date": "2021-09-21 00:00:00", + "start": "2021-09-20T16:00:00.000Z", + "end": "2021-09-21T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2021-09-28 00:00:00", + "start": "2021-09-27T16:00:00.000Z", + "end": "2021-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Tue" + }, + { + "date": "2021-10-10 00:00:00", + "start": "2021-10-09T16:00:00.000Z", + "end": "2021-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2021-10-11 00:00:00", + "start": "2021-10-10T16:00:00.000Z", + "end": "2021-10-11T16:00:00.000Z", + "name": "國慶日 / 雙十節 (substitute day)", + "type": "public", + "substitute": true, + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2021-10-14 00:00:00", + "start": "2021-10-13T16:00:00.000Z", + "end": "2021-10-14T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Thu" + }, + { + "date": "2021-10-21 00:00:00", + "start": "2021-10-20T16:00:00.000Z", + "end": "2021-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Thu" + }, + { + "date": "2021-10-25 00:00:00", + "start": "2021-10-24T16:00:00.000Z", + "end": "2021-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Mon" + }, + { + "date": "2021-11-12 00:00:00", + "start": "2021-11-11T16:00:00.000Z", + "end": "2021-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Fri" + }, + { + "date": "2021-11-19 00:00:00", + "start": "2021-11-18T16:00:00.000Z", + "end": "2021-11-19T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Fri" + }, + { + "date": "2021-12-21 00:00:00", + "start": "2021-12-20T16:00:00.000Z", + "end": "2021-12-21T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Tue" + }, + { + "date": "2021-12-25 00:00:00", + "start": "2021-12-24T16:00:00.000Z", + "end": "2021-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Sat" + }, + { + "date": "2021-12-31 00:00:00", + "start": "2021-12-30T16:00:00.000Z", + "end": "2021-12-31T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦 (substitute day)", + "type": "public", + "substitute": true, + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Fri" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2022.json b/test/fixtures/TW-2022.json new file mode 100644 index 000000000..d32c5a067 --- /dev/null +++ b/test/fixtures/TW-2022.json @@ -0,0 +1,402 @@ +[ + { + "date": "2022-01-01 00:00:00", + "start": "2021-12-31T16:00:00.000Z", + "end": "2022-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2022-01-31 00:00:00", + "start": "2022-01-30T16:00:00.000Z", + "end": "2022-01-31T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Mon" + }, + { + "date": "2022-02-01 00:00:00", + "start": "2022-01-31T16:00:00.000Z", + "end": "2022-02-01T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Tue" + }, + { + "date": "2022-02-02 00:00:00", + "start": "2022-02-01T16:00:00.000Z", + "end": "2022-02-02T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Wed" + }, + { + "date": "2022-02-03 00:00:00", + "start": "2022-02-02T16:00:00.000Z", + "end": "2022-02-03T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Thu" + }, + { + "date": "2022-02-04 00:00:00", + "start": "2022-02-03T16:00:00.000Z", + "end": "2022-02-04T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Fri" + }, + { + "date": "2022-02-04 00:00:00", + "start": "2022-02-03T16:00:00.000Z", + "end": "2022-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Fri" + }, + { + "date": "2022-02-05 00:00:00", + "start": "2022-02-04T16:00:00.000Z", + "end": "2022-02-05T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Sat" + }, + { + "date": "2022-02-15 00:00:00", + "start": "2022-02-14T16:00:00.000Z", + "end": "2022-02-15T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Tue" + }, + { + "date": "2022-02-15 00:00:00", + "start": "2022-02-14T16:00:00.000Z", + "end": "2022-02-15T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Tue" + }, + { + "date": "2022-02-28 00:00:00", + "start": "2022-02-27T16:00:00.000Z", + "end": "2022-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2022-03-04 00:00:00", + "start": "2022-03-03T16:00:00.000Z", + "end": "2022-03-04T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Fri" + }, + { + "date": "2022-03-08 00:00:00", + "start": "2022-03-07T16:00:00.000Z", + "end": "2022-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Tue" + }, + { + "date": "2022-03-12 00:00:00", + "start": "2022-03-11T16:00:00.000Z", + "end": "2022-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Sat" + }, + { + "date": "2022-03-21 00:00:00", + "start": "2022-03-20T16:00:00.000Z", + "end": "2022-03-21T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Mon" + }, + { + "date": "2022-03-29 00:00:00", + "start": "2022-03-28T16:00:00.000Z", + "end": "2022-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Tue" + }, + { + "date": "2022-04-04 00:00:00", + "start": "2022-04-03T16:00:00.000Z", + "end": "2022-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2022-04-05 00:00:00", + "start": "2022-04-04T16:00:00.000Z", + "end": "2022-04-05T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2022-04-15 00:00:00", + "start": "2022-04-14T16:00:00.000Z", + "end": "2022-04-15T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Fri" + }, + { + "date": "2022-04-23 00:00:00", + "start": "2022-04-22T16:00:00.000Z", + "end": "2022-04-23T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Sat" + }, + { + "date": "2022-05-01 00:00:00", + "start": "2022-04-30T16:00:00.000Z", + "end": "2022-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2022-05-02 00:00:00", + "start": "2022-05-01T16:00:00.000Z", + "end": "2022-05-02T16:00:00.000Z", + "name": "勞動節 (substitute day)", + "type": "observance", + "note": "private sector", + "substitute": true, + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2022-05-04 00:00:00", + "start": "2022-05-03T16:00:00.000Z", + "end": "2022-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Wed" + }, + { + "date": "2022-05-08 00:00:00", + "start": "2022-05-07T16:00:00.000Z", + "end": "2022-05-08T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Sun" + }, + { + "date": "2022-05-08 00:00:00", + "start": "2022-05-07T16:00:00.000Z", + "end": "2022-05-08T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2022-06-03 00:00:00", + "start": "2022-06-02T16:00:00.000Z", + "end": "2022-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Fri" + }, + { + "date": "2022-06-03 00:00:00", + "start": "2022-06-02T16:00:00.000Z", + "end": "2022-06-03T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2022-06-11 00:00:00", + "start": "2022-06-10T16:00:00.000Z", + "end": "2022-06-11T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Sat" + }, + { + "date": "2022-06-11 00:00:00", + "start": "2022-06-10T16:00:00.000Z", + "end": "2022-06-11T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Sat" + }, + { + "date": "2022-08-04 00:00:00", + "start": "2022-08-03T16:00:00.000Z", + "end": "2022-08-04T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Thu" + }, + { + "date": "2022-08-08 00:00:00", + "start": "2022-08-07T16:00:00.000Z", + "end": "2022-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Mon" + }, + { + "date": "2022-08-12 00:00:00", + "start": "2022-08-11T16:00:00.000Z", + "end": "2022-08-12T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Fri" + }, + { + "date": "2022-09-01 00:00:00", + "start": "2022-08-31T16:00:00.000Z", + "end": "2022-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Thu" + }, + { + "date": "2022-09-03 00:00:00", + "start": "2022-09-02T16:00:00.000Z", + "end": "2022-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Sat" + }, + { + "date": "2022-09-10 00:00:00", + "start": "2022-09-09T16:00:00.000Z", + "end": "2022-09-10T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2022-09-28 00:00:00", + "start": "2022-09-27T16:00:00.000Z", + "end": "2022-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Wed" + }, + { + "date": "2022-10-04 00:00:00", + "start": "2022-10-03T16:00:00.000Z", + "end": "2022-10-04T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Tue" + }, + { + "date": "2022-10-10 00:00:00", + "start": "2022-10-09T16:00:00.000Z", + "end": "2022-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2022-10-21 00:00:00", + "start": "2022-10-20T16:00:00.000Z", + "end": "2022-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Fri" + }, + { + "date": "2022-10-25 00:00:00", + "start": "2022-10-24T16:00:00.000Z", + "end": "2022-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Tue" + }, + { + "date": "2022-11-08 00:00:00", + "start": "2022-11-07T16:00:00.000Z", + "end": "2022-11-08T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Tue" + }, + { + "date": "2022-11-12 00:00:00", + "start": "2022-11-11T16:00:00.000Z", + "end": "2022-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Sat" + }, + { + "date": "2022-12-21 00:00:00", + "start": "2022-12-20T16:00:00.000Z", + "end": "2022-12-21T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Wed" + }, + { + "date": "2022-12-25 00:00:00", + "start": "2022-12-24T16:00:00.000Z", + "end": "2022-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Sun" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2023.json b/test/fixtures/TW-2023.json new file mode 100644 index 000000000..e3c9bd670 --- /dev/null +++ b/test/fixtures/TW-2023.json @@ -0,0 +1,401 @@ +[ + { + "date": "2023-01-01 00:00:00", + "start": "2022-12-31T16:00:00.000Z", + "end": "2023-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Sun" + }, + { + "date": "2023-01-02 00:00:00", + "start": "2023-01-01T16:00:00.000Z", + "end": "2023-01-02T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦 (substitute day)", + "type": "public", + "substitute": true, + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2023-01-21 00:00:00", + "start": "2023-01-20T16:00:00.000Z", + "end": "2023-01-21T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Sat" + }, + { + "date": "2023-01-22 00:00:00", + "start": "2023-01-21T16:00:00.000Z", + "end": "2023-01-22T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Sun" + }, + { + "date": "2023-01-23 00:00:00", + "start": "2023-01-22T16:00:00.000Z", + "end": "2023-01-23T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Mon" + }, + { + "date": "2023-01-24 00:00:00", + "start": "2023-01-23T16:00:00.000Z", + "end": "2023-01-24T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Tue" + }, + { + "date": "2023-01-25 00:00:00", + "start": "2023-01-24T16:00:00.000Z", + "end": "2023-01-25T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Wed" + }, + { + "date": "2023-01-26 00:00:00", + "start": "2023-01-25T16:00:00.000Z", + "end": "2023-01-26T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Thu" + }, + { + "date": "2023-02-04 00:00:00", + "start": "2023-02-03T16:00:00.000Z", + "end": "2023-02-04T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Sat" + }, + { + "date": "2023-02-04 00:00:00", + "start": "2023-02-03T16:00:00.000Z", + "end": "2023-02-04T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Sat" + }, + { + "date": "2023-02-04 00:00:00", + "start": "2023-02-03T16:00:00.000Z", + "end": "2023-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Sat" + }, + { + "date": "2023-02-21 00:00:00", + "start": "2023-02-20T16:00:00.000Z", + "end": "2023-02-21T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Tue" + }, + { + "date": "2023-02-28 00:00:00", + "start": "2023-02-27T16:00:00.000Z", + "end": "2023-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2023-03-08 00:00:00", + "start": "2023-03-07T16:00:00.000Z", + "end": "2023-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Wed" + }, + { + "date": "2023-03-10 00:00:00", + "start": "2023-03-09T16:00:00.000Z", + "end": "2023-03-10T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Fri" + }, + { + "date": "2023-03-12 00:00:00", + "start": "2023-03-11T16:00:00.000Z", + "end": "2023-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Sun" + }, + { + "date": "2023-03-29 00:00:00", + "start": "2023-03-28T16:00:00.000Z", + "end": "2023-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Wed" + }, + { + "date": "2023-04-04 00:00:00", + "start": "2023-04-03T16:00:00.000Z", + "end": "2023-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2023-04-05 00:00:00", + "start": "2023-04-04T16:00:00.000Z", + "end": "2023-04-05T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2023-05-01 00:00:00", + "start": "2023-04-30T16:00:00.000Z", + "end": "2023-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2023-05-04 00:00:00", + "start": "2023-05-03T16:00:00.000Z", + "end": "2023-05-04T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Thu" + }, + { + "date": "2023-05-04 00:00:00", + "start": "2023-05-03T16:00:00.000Z", + "end": "2023-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Thu" + }, + { + "date": "2023-05-12 00:00:00", + "start": "2023-05-11T16:00:00.000Z", + "end": "2023-05-12T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Fri" + }, + { + "date": "2023-05-14 00:00:00", + "start": "2023-05-13T16:00:00.000Z", + "end": "2023-05-14T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2023-05-26 00:00:00", + "start": "2023-05-25T16:00:00.000Z", + "end": "2023-05-26T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Fri" + }, + { + "date": "2023-06-03 00:00:00", + "start": "2023-06-02T16:00:00.000Z", + "end": "2023-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Sat" + }, + { + "date": "2023-06-22 00:00:00", + "start": "2023-06-21T16:00:00.000Z", + "end": "2023-06-22T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2023-06-30 00:00:00", + "start": "2023-06-29T16:00:00.000Z", + "end": "2023-06-30T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Fri" + }, + { + "date": "2023-06-30 00:00:00", + "start": "2023-06-29T16:00:00.000Z", + "end": "2023-06-30T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Fri" + }, + { + "date": "2023-08-08 00:00:00", + "start": "2023-08-07T16:00:00.000Z", + "end": "2023-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Tue" + }, + { + "date": "2023-08-22 00:00:00", + "start": "2023-08-21T16:00:00.000Z", + "end": "2023-08-22T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Tue" + }, + { + "date": "2023-08-30 00:00:00", + "start": "2023-08-29T16:00:00.000Z", + "end": "2023-08-30T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Wed" + }, + { + "date": "2023-09-01 00:00:00", + "start": "2023-08-31T16:00:00.000Z", + "end": "2023-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Fri" + }, + { + "date": "2023-09-03 00:00:00", + "start": "2023-09-02T16:00:00.000Z", + "end": "2023-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Sun" + }, + { + "date": "2023-09-28 00:00:00", + "start": "2023-09-27T16:00:00.000Z", + "end": "2023-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Thu" + }, + { + "date": "2023-09-29 00:00:00", + "start": "2023-09-28T16:00:00.000Z", + "end": "2023-09-29T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2023-10-10 00:00:00", + "start": "2023-10-09T16:00:00.000Z", + "end": "2023-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2023-10-21 00:00:00", + "start": "2023-10-20T16:00:00.000Z", + "end": "2023-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Sat" + }, + { + "date": "2023-10-23 00:00:00", + "start": "2023-10-22T16:00:00.000Z", + "end": "2023-10-23T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Mon" + }, + { + "date": "2023-10-25 00:00:00", + "start": "2023-10-24T16:00:00.000Z", + "end": "2023-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Wed" + }, + { + "date": "2023-11-12 00:00:00", + "start": "2023-11-11T16:00:00.000Z", + "end": "2023-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Sun" + }, + { + "date": "2023-11-27 00:00:00", + "start": "2023-11-26T16:00:00.000Z", + "end": "2023-11-27T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Mon" + }, + { + "date": "2023-12-22 00:00:00", + "start": "2023-12-21T16:00:00.000Z", + "end": "2023-12-22T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Fri" + }, + { + "date": "2023-12-25 00:00:00", + "start": "2023-12-24T16:00:00.000Z", + "end": "2023-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Mon" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2024.json b/test/fixtures/TW-2024.json new file mode 100644 index 000000000..3e166d418 --- /dev/null +++ b/test/fixtures/TW-2024.json @@ -0,0 +1,391 @@ +[ + { + "date": "2024-01-01 00:00:00", + "start": "2023-12-31T16:00:00.000Z", + "end": "2024-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2024-02-04 00:00:00", + "start": "2024-02-03T16:00:00.000Z", + "end": "2024-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Sun" + }, + { + "date": "2024-02-09 00:00:00", + "start": "2024-02-08T16:00:00.000Z", + "end": "2024-02-09T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Fri" + }, + { + "date": "2024-02-10 00:00:00", + "start": "2024-02-09T16:00:00.000Z", + "end": "2024-02-10T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Sat" + }, + { + "date": "2024-02-11 00:00:00", + "start": "2024-02-10T16:00:00.000Z", + "end": "2024-02-11T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Sun" + }, + { + "date": "2024-02-12 00:00:00", + "start": "2024-02-11T16:00:00.000Z", + "end": "2024-02-12T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Mon" + }, + { + "date": "2024-02-13 00:00:00", + "start": "2024-02-12T16:00:00.000Z", + "end": "2024-02-13T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Tue" + }, + { + "date": "2024-02-14 00:00:00", + "start": "2024-02-13T16:00:00.000Z", + "end": "2024-02-14T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Wed" + }, + { + "date": "2024-02-24 00:00:00", + "start": "2024-02-23T16:00:00.000Z", + "end": "2024-02-24T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Sat" + }, + { + "date": "2024-02-24 00:00:00", + "start": "2024-02-23T16:00:00.000Z", + "end": "2024-02-24T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Sat" + }, + { + "date": "2024-02-28 00:00:00", + "start": "2024-02-27T16:00:00.000Z", + "end": "2024-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2024-03-08 00:00:00", + "start": "2024-03-07T16:00:00.000Z", + "end": "2024-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Fri" + }, + { + "date": "2024-03-11 00:00:00", + "start": "2024-03-10T16:00:00.000Z", + "end": "2024-03-11T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Mon" + }, + { + "date": "2024-03-12 00:00:00", + "start": "2024-03-11T16:00:00.000Z", + "end": "2024-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Tue" + }, + { + "date": "2024-03-28 00:00:00", + "start": "2024-03-27T16:00:00.000Z", + "end": "2024-03-28T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Thu" + }, + { + "date": "2024-03-29 00:00:00", + "start": "2024-03-28T16:00:00.000Z", + "end": "2024-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Fri" + }, + { + "date": "2024-04-04 00:00:00", + "start": "2024-04-03T16:00:00.000Z", + "end": "2024-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2024-04-04 00:00:00", + "start": "2024-04-03T16:00:00.000Z", + "end": "2024-04-04T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2024-04-23 00:00:00", + "start": "2024-04-22T16:00:00.000Z", + "end": "2024-04-23T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Tue" + }, + { + "date": "2024-05-01 00:00:00", + "start": "2024-04-30T16:00:00.000Z", + "end": "2024-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2024-05-01 00:00:00", + "start": "2024-04-30T16:00:00.000Z", + "end": "2024-05-01T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Wed" + }, + { + "date": "2024-05-04 00:00:00", + "start": "2024-05-03T16:00:00.000Z", + "end": "2024-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Sat" + }, + { + "date": "2024-05-12 00:00:00", + "start": "2024-05-11T16:00:00.000Z", + "end": "2024-05-12T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2024-05-15 00:00:00", + "start": "2024-05-14T16:00:00.000Z", + "end": "2024-05-15T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Wed" + }, + { + "date": "2024-06-03 00:00:00", + "start": "2024-06-02T16:00:00.000Z", + "end": "2024-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Mon" + }, + { + "date": "2024-06-10 00:00:00", + "start": "2024-06-09T16:00:00.000Z", + "end": "2024-06-10T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2024-06-18 00:00:00", + "start": "2024-06-17T16:00:00.000Z", + "end": "2024-06-18T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Tue" + }, + { + "date": "2024-06-18 00:00:00", + "start": "2024-06-17T16:00:00.000Z", + "end": "2024-06-18T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Tue" + }, + { + "date": "2024-08-08 00:00:00", + "start": "2024-08-07T16:00:00.000Z", + "end": "2024-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Thu" + }, + { + "date": "2024-08-10 00:00:00", + "start": "2024-08-09T16:00:00.000Z", + "end": "2024-08-10T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Sat" + }, + { + "date": "2024-08-18 00:00:00", + "start": "2024-08-17T16:00:00.000Z", + "end": "2024-08-18T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Sun" + }, + { + "date": "2024-09-01 00:00:00", + "start": "2024-08-31T16:00:00.000Z", + "end": "2024-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Sun" + }, + { + "date": "2024-09-03 00:00:00", + "start": "2024-09-02T16:00:00.000Z", + "end": "2024-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Tue" + }, + { + "date": "2024-09-17 00:00:00", + "start": "2024-09-16T16:00:00.000Z", + "end": "2024-09-17T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Tue" + }, + { + "date": "2024-09-28 00:00:00", + "start": "2024-09-27T16:00:00.000Z", + "end": "2024-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Sat" + }, + { + "date": "2024-10-10 00:00:00", + "start": "2024-10-09T16:00:00.000Z", + "end": "2024-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2024-10-11 00:00:00", + "start": "2024-10-10T16:00:00.000Z", + "end": "2024-10-11T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Fri" + }, + { + "date": "2024-10-21 00:00:00", + "start": "2024-10-20T16:00:00.000Z", + "end": "2024-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Mon" + }, + { + "date": "2024-10-25 00:00:00", + "start": "2024-10-24T16:00:00.000Z", + "end": "2024-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Fri" + }, + { + "date": "2024-11-12 00:00:00", + "start": "2024-11-11T16:00:00.000Z", + "end": "2024-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Tue" + }, + { + "date": "2024-11-15 00:00:00", + "start": "2024-11-14T16:00:00.000Z", + "end": "2024-11-15T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Fri" + }, + { + "date": "2024-12-21 00:00:00", + "start": "2024-12-20T16:00:00.000Z", + "end": "2024-12-21T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Sat" + }, + { + "date": "2024-12-25 00:00:00", + "start": "2024-12-24T16:00:00.000Z", + "end": "2024-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Wed" + } +] \ No newline at end of file diff --git a/test/fixtures/TW-2025.json b/test/fixtures/TW-2025.json new file mode 100644 index 000000000..fab4c9332 --- /dev/null +++ b/test/fixtures/TW-2025.json @@ -0,0 +1,391 @@ +[ + { + "date": "2025-01-01 00:00:00", + "start": "2024-12-31T16:00:00.000Z", + "end": "2025-01-01T16:00:00.000Z", + "name": "中華民國開國紀念日 / 元旦", + "type": "public", + "rule": "01-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Wed" + }, + { + "date": "2025-01-28 00:00:00", + "start": "2025-01-27T16:00:00.000Z", + "end": "2025-01-28T16:00:00.000Z", + "name": "農曆除夕", + "type": "public", + "rule": "chinese 01-0-00", + "_weekday": "Tue" + }, + { + "date": "2025-01-29 00:00:00", + "start": "2025-01-28T16:00:00.000Z", + "end": "2025-01-29T16:00:00.000Z", + "name": "農曆年初一", + "type": "public", + "rule": "chinese 01-0-01", + "_weekday": "Wed" + }, + { + "date": "2025-01-30 00:00:00", + "start": "2025-01-29T16:00:00.000Z", + "end": "2025-01-30T16:00:00.000Z", + "name": "農曆年初二", + "type": "public", + "rule": "chinese 01-0-02", + "_weekday": "Thu" + }, + { + "date": "2025-01-31 00:00:00", + "start": "2025-01-30T16:00:00.000Z", + "end": "2025-01-31T16:00:00.000Z", + "name": "農曆年初三", + "type": "public", + "rule": "chinese 01-0-03", + "_weekday": "Fri" + }, + { + "date": "2025-02-01 00:00:00", + "start": "2025-01-31T16:00:00.000Z", + "end": "2025-02-01T16:00:00.000Z", + "name": "農曆年初四", + "type": "public", + "rule": "chinese 01-0-04", + "_weekday": "Sat" + }, + { + "date": "2025-02-02 00:00:00", + "start": "2025-02-01T16:00:00.000Z", + "end": "2025-02-02T16:00:00.000Z", + "name": "农历新年假期", + "type": "public", + "rule": "chinese 01-0-01 if Monday then next Friday if Tuesday then next Saturdayif Wednesday then next Sunday if Thursday then next Monday if Friday then next Tuesday if Saturday then next Wednesday if Sunday then next Thursday", + "_weekday": "Sun" + }, + { + "date": "2025-02-04 00:00:00", + "start": "2025-02-03T16:00:00.000Z", + "end": "2025-02-04T16:00:00.000Z", + "name": "農民節", + "type": "observance", + "rule": "02-04", + "_weekday": "Tue" + }, + { + "date": "2025-02-12 00:00:00", + "start": "2025-02-11T16:00:00.000Z", + "end": "2025-02-12T16:00:00.000Z", + "name": "元宵節", + "type": "observance", + "rule": "chinese 01-0-15", + "_weekday": "Wed" + }, + { + "date": "2025-02-12 00:00:00", + "start": "2025-02-11T16:00:00.000Z", + "end": "2025-02-12T16:00:00.000Z", + "name": "觀光節", + "type": "observance", + "rule": "chinese 01-0-15 #1", + "_weekday": "Wed" + }, + { + "date": "2025-02-28 00:00:00", + "start": "2025-02-27T16:00:00.000Z", + "end": "2025-02-28T16:00:00.000Z", + "name": "228和平紀念日", + "type": "public", + "rule": "02-28 and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2025-03-01 00:00:00", + "start": "2025-02-28T16:00:00.000Z", + "end": "2025-03-01T16:00:00.000Z", + "name": "土地公誕辰", + "type": "observance", + "rule": "chinese 02-0-02", + "_weekday": "Sat" + }, + { + "date": "2025-03-08 00:00:00", + "start": "2025-03-07T16:00:00.000Z", + "end": "2025-03-08T16:00:00.000Z", + "name": "国际妇女节", + "type": "observance", + "rule": "03-08", + "_weekday": "Sat" + }, + { + "date": "2025-03-12 00:00:00", + "start": "2025-03-11T16:00:00.000Z", + "end": "2025-03-12T16:00:00.000Z", + "name": "國父逝世紀念日", + "type": "observance", + "rule": "03-12", + "_weekday": "Wed" + }, + { + "date": "2025-03-18 00:00:00", + "start": "2025-03-17T16:00:00.000Z", + "end": "2025-03-18T16:00:00.000Z", + "name": "觀音誕辰", + "type": "observance", + "rule": "chinese 02-0-19", + "_weekday": "Tue" + }, + { + "date": "2025-03-29 00:00:00", + "start": "2025-03-28T16:00:00.000Z", + "end": "2025-03-29T16:00:00.000Z", + "name": "靑年節", + "type": "observance", + "rule": "03-29", + "_weekday": "Sat" + }, + { + "date": "2025-04-04 00:00:00", + "start": "2025-04-03T16:00:00.000Z", + "end": "2025-04-04T16:00:00.000Z", + "name": "兒童節", + "type": "public", + "rule": "04-04 and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2025-04-04 00:00:00", + "start": "2025-04-03T16:00:00.000Z", + "end": "2025-04-04T16:00:00.000Z", + "name": "淸明節", + "type": "public", + "rule": "chinese 5-01 solarterm and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2025-04-12 00:00:00", + "start": "2025-04-11T16:00:00.000Z", + "end": "2025-04-12T16:00:00.000Z", + "name": "保生大帝誕辰", + "type": "observance", + "rule": "chinese 03-0-15", + "_weekday": "Sat" + }, + { + "date": "2025-04-20 00:00:00", + "start": "2025-04-19T16:00:00.000Z", + "end": "2025-04-20T16:00:00.000Z", + "name": "媽祖誕辰", + "type": "observance", + "rule": "chinese 03-0-23", + "_weekday": "Sun" + }, + { + "date": "2025-05-01 00:00:00", + "start": "2025-04-30T16:00:00.000Z", + "end": "2025-05-01T16:00:00.000Z", + "name": "勞動節", + "type": "observance", + "note": "private sector", + "rule": "05-01 and if Saturday then previous Friday if Sunday then next Monday", + "_weekday": "Thu" + }, + { + "date": "2025-05-04 00:00:00", + "start": "2025-05-03T16:00:00.000Z", + "end": "2025-05-04T16:00:00.000Z", + "name": "文藝節", + "type": "observance", + "rule": "05-04", + "_weekday": "Sun" + }, + { + "date": "2025-05-05 00:00:00", + "start": "2025-05-04T16:00:00.000Z", + "end": "2025-05-05T16:00:00.000Z", + "name": "佛誕日", + "type": "observance", + "rule": "chinese 04-0-08", + "_weekday": "Mon" + }, + { + "date": "2025-05-11 00:00:00", + "start": "2025-05-10T16:00:00.000Z", + "end": "2025-05-11T16:00:00.000Z", + "name": "母親節", + "type": "observance", + "rule": "2nd Sunday in May", + "_weekday": "Sun" + }, + { + "date": "2025-05-31 00:00:00", + "start": "2025-05-30T16:00:00.000Z", + "end": "2025-05-31T16:00:00.000Z", + "name": "端午節", + "type": "public", + "rule": "chinese 05-0-05 and if Sunday then next Monday", + "_weekday": "Sat" + }, + { + "date": "2025-06-03 00:00:00", + "start": "2025-06-02T16:00:00.000Z", + "end": "2025-06-03T16:00:00.000Z", + "name": "禁菸節", + "type": "observance", + "rule": "06-03", + "_weekday": "Tue" + }, + { + "date": "2025-06-08 00:00:00", + "start": "2025-06-07T16:00:00.000Z", + "end": "2025-06-08T16:00:00.000Z", + "name": "城隍爺誕辰", + "type": "observance", + "rule": "chinese 05-0-13 #1", + "_weekday": "Sun" + }, + { + "date": "2025-06-08 00:00:00", + "start": "2025-06-07T16:00:00.000Z", + "end": "2025-06-08T16:00:00.000Z", + "name": "關公誕辰", + "type": "observance", + "rule": "chinese 05-0-13", + "_weekday": "Sun" + }, + { + "date": "2025-08-08 00:00:00", + "start": "2025-08-07T16:00:00.000Z", + "end": "2025-08-08T16:00:00.000Z", + "name": "父親節", + "type": "observance", + "rule": "08-08", + "_weekday": "Fri" + }, + { + "date": "2025-08-29 00:00:00", + "start": "2025-08-28T16:00:00.000Z", + "end": "2025-08-29T16:00:00.000Z", + "name": "七夕", + "type": "observance", + "rule": "chinese 07-0-07", + "_weekday": "Fri" + }, + { + "date": "2025-09-01 00:00:00", + "start": "2025-08-31T16:00:00.000Z", + "end": "2025-09-01T16:00:00.000Z", + "name": "記者節", + "type": "observance", + "rule": "09-01", + "_weekday": "Mon" + }, + { + "date": "2025-09-03 00:00:00", + "start": "2025-09-02T16:00:00.000Z", + "end": "2025-09-03T16:00:00.000Z", + "name": "軍人節", + "type": "observance", + "rule": "09-03", + "_weekday": "Wed" + }, + { + "date": "2025-09-06 00:00:00", + "start": "2025-09-05T16:00:00.000Z", + "end": "2025-09-06T16:00:00.000Z", + "name": "中元節", + "type": "observance", + "rule": "chinese 07-0-15", + "_weekday": "Sat" + }, + { + "date": "2025-09-28 00:00:00", + "start": "2025-09-27T16:00:00.000Z", + "end": "2025-09-28T16:00:00.000Z", + "name": "孔子誕辰紀念日", + "type": "observance", + "rule": "09-28", + "_weekday": "Sun" + }, + { + "date": "2025-10-06 00:00:00", + "start": "2025-10-05T16:00:00.000Z", + "end": "2025-10-06T16:00:00.000Z", + "name": "中秋節", + "type": "public", + "rule": "chinese 08-0-15 and if Sunday then next Monday", + "_weekday": "Mon" + }, + { + "date": "2025-10-10 00:00:00", + "start": "2025-10-09T16:00:00.000Z", + "end": "2025-10-10T16:00:00.000Z", + "name": "國慶日 / 雙十節", + "type": "public", + "rule": "10-10 and if Sunday then next Monday", + "_weekday": "Fri" + }, + { + "date": "2025-10-21 00:00:00", + "start": "2025-10-20T16:00:00.000Z", + "end": "2025-10-21T16:00:00.000Z", + "name": "華僑節", + "type": "observance", + "rule": "10-21", + "_weekday": "Tue" + }, + { + "date": "2025-10-25 00:00:00", + "start": "2025-10-24T16:00:00.000Z", + "end": "2025-10-25T16:00:00.000Z", + "name": "臺灣光復節", + "type": "observance", + "rule": "10-25", + "_weekday": "Sat" + }, + { + "date": "2025-10-29 00:00:00", + "start": "2025-10-28T16:00:00.000Z", + "end": "2025-10-29T16:00:00.000Z", + "name": "重陽節", + "type": "observance", + "rule": "chinese 09-0-09", + "_weekday": "Wed" + }, + { + "date": "2025-11-12 00:00:00", + "start": "2025-11-11T16:00:00.000Z", + "end": "2025-11-12T16:00:00.000Z", + "name": "國父誕辰紀念日", + "type": "observance", + "note": "Also Doctors' Day and Cultural Renaissance Day", + "rule": "11-12", + "_weekday": "Wed" + }, + { + "date": "2025-12-04 00:00:00", + "start": "2025-12-03T16:00:00.000Z", + "end": "2025-12-04T16:00:00.000Z", + "name": "賽夏節", + "type": "observance", + "rule": "chinese 10-0-15", + "_weekday": "Thu" + }, + { + "date": "2025-12-21 00:00:00", + "start": "2025-12-20T16:00:00.000Z", + "end": "2025-12-21T16:00:00.000Z", + "name": "冬至", + "type": "observance", + "rule": "december solstice", + "_weekday": "Sun" + }, + { + "date": "2025-12-25 00:00:00", + "start": "2025-12-24T16:00:00.000Z", + "end": "2025-12-25T16:00:00.000Z", + "name": "行憲紀念日", + "type": "observance", + "rule": "12-25", + "_weekday": "Thu" + } +] \ No newline at end of file