Skip to content

A platform for community discussion. Free, open, simple.

3.9 KB
Raw Blame
# Thai holiday definitions for the Ruby Holiday gem.
#
# Updated: 2019-01-14.
# Sources:
# - https://en.wikipedia.org/wiki/Public_holidays_in_Thailand
---
months:
  1:
  - name: วันขึ้นปีใหม่
    regions: [th]
    mday: 1
  4:
  - name: วันจักรี
    regions: [th]
    mday: 6
  - name: วันสงกรานต์
    regions: [th]
    mday: 13
  - name: วันสงกรานต์
    regions: [th]
    mday: 14
  - name: วันสงกรานต์
    regions: [th]
    mday: 15
  7:
  - name: วันเฉลิมพระชนมพรรษาสมเด็จพระเจ้าอยู่หัวมหาวชิราลงกรณ บดินทรเทพยวรางกูร
    regions: [th]
    mday: 28
  8:
  - name: วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถในรัชกาลที่ ๙
    regions: [th]
    mday: 12
  10:
  - name: วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร
    regions: [th]
    mday: 13
  - name: วันปิยมหาราช
    regions: [th]
    mday: 23
  12:
  - name: วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร
    regions: [th]
    mday: 5
  - name: วันรัฐธรรมนูญ
    regions: [th]
    mday: 10
  - name: วันสิ้นปี
    regions: [th]
    mday: 31

tests:
  - given:
      date: '20019-01-01'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันขึ้นปีใหม่"
  - given:
      date: '2019-04-06'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันจักรี"
  - given:
      date: ['2019-04-13', '2019-04-14', '2019-04-15']
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันสงกรานต์"
  - given:
      date: '2019-07-28'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันเฉลิมพระชนมพรรษาสมเด็จพระเจ้าอยู่หัวมหาวชิราลงกรณ บดินทรเทพยวรางกูร"
  - given:
      date: '2007-08-12'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถในรัชกาลที่ ๙"
  - given:
      date: '2019-10-13'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร"
  - given:
      date: '2019-10-23'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันปิยมหาราช"
  - given:
      date: '2019-12-05'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร"
  - given:
      date: '2019-12-10'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันรัฐธรรมนูญ"
  - given:
      date: '2019-12-31'
      regions: ["th"]
      options: ["informal"]
    expect:
      name: "วันสิ้นปี"