Skip to content

Commit

Permalink
Merge pull request #141 from svict4/master
Browse files Browse the repository at this point in the history
  • Loading branch information
commenthol committed Feb 29, 2020
2 parents 1e885a0 + 94f57fb commit 2a7af6c
Show file tree
Hide file tree
Showing 76 changed files with 734 additions and 2,617 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ Countries: 144
│ ├── QLD: Queensland
│ ├── SA: South Australia
│ ├── TAS: Tasmania
│ │ ├── H: Hobart
│ │ └── NH: Non-Hobart
│ ├── VIC: Victoria
│ │ └── M: Melbourne
│ └── WA: Western Australia
├── AW: Aruba
├── AX: Landskapet Åland
Expand Down
181 changes: 95 additions & 86 deletions data/countries/AU.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ holidays:
- Australia/Eucla
days:
01-01 and if saturday,sunday then next monday:
substitute: true
_name: 01-01
01-26 and if saturday,sunday then next monday:
01-26 if saturday,sunday then next monday:
substitute: true
name:
en: Australia Day
Expand All @@ -35,33 +34,25 @@ holidays:
_name: easter -1
easter:
_name: easter
type: observance
easter 1:
_name: easter 1
04-25 and if saturday,sunday then next monday:
substitute: true
04-25:
name:
en: ANZAC Day
en: Anzac Day
2nd monday in June:
name:
en: Queen's Birthday
12-24:
_name: 12-24
type: observance
12-25 and if saturday then next monday:
substitute: true
_name: 12-25
substitutes 12-25 if sunday then next tuesday:
1st monday in October:
name:
en: Labour Day
12-25 and if saturday then next monday if sunday then next tuesday:
substitute: true
_name: 12-25
12-26 and if saturday,sunday then next monday:
12-26 and if saturday then next monday if sunday then next tuesday:
substitute: true
_name: 12-26
12-31:
_name: 12-31
type: observance
states:
# @source http://www.cmd.act.gov.au/communication/holidays
# @source https://www.legislation.act.gov.au/a/1958-19
ACT:
name: Australian Capital Territory
zones:
Expand All @@ -70,112 +61,127 @@ holidays:
2nd monday in March:
name:
en: Canberra Day
easter:
04-25: false
04-25 if sunday then next monday:
substitute: true
name:
en: Anzac Day
'2020-04-27':
name:
en: Declared public holiday
type: public
'monday before 10-01':
monday after 05-27:
name:
en: Family & Community Day
note: 'rule missing: When Family and Community Day falls on Labour Day holiday, it changes to the 2nd Monday of 3rd term school holidays'
1st monday in October:
name: Labour Day
# @source http://www.industrialrelations.nsw.gov.au/oirwww/NSW_public_holidays/NSW_Public_Holidays.page?
en: Reconciliation Day
# @source https://www.legislation.nsw.gov.au/~/pdf/view/act/2010/115/whole
NSW:
name: New South Wales
zones:
- Australia/Sydney
days:
easter:
type: public
1st monday in August:
name:
en: Bank Holiday
type: bank
1st monday in October:
name:
en: Labour Day
# @source http://www.ocpe.nt.gov.au/working_in_the_ntps/legislation/public_holidays
# @source https://legislation.nt.gov.au/en/Legislation/PUBLIC-HOLIDAYS-ACT-1981
NT:
name: Northern Territory
zones:
- Australia/Darwin
days:
easter: false
04-25: false
04-25 if sunday then next monday:
substitute: true
name:
en: Anzac Day
1st monday in May:
name:
en: May Day
1st monday in August:
name:
en: Picnic Day
# @source https://www.qld.gov.au/recreation/travel/holidays/public
1st monday in October: false
12-24 19:00:
_name: 12-24
12-25 and if saturday then next monday if sunday then next tuesday: false
12-25 if saturday then next monday if sunday then next tuesday:
substitute: true
_name: 12-25
12-26 and if saturday then next monday if sunday then next tuesday: false
12-26 if saturday then next monday if sunday then next tuesday:
substitute: true
_name: 12-26
12-31 19:00:
_name: 12-31
# @source https://www.legislation.qld.gov.au/view/html/inforce/current/act-1983-018
QLD:
name: Queensland
zones:
- Australia/Brisbane
- Australia/Lindeman
days:
'1st monday in October #1':
04-25: false
04-25 if sunday then next monday:
substitute: true
name:
en: Labour Day
active:
- from: '2013-01-01'
to: '2016-01-01'
en: Anzac Day
1st monday in May:
name:
en: Labour Day
active:
- from: '2016-01-01'
2nd monday in June:
active:
- to: '2016-01-01'
'1st monday in October #2':
2nd monday in June: false
1st monday in October:
name:
en: Queen's Birthday
active:
- from: '2016-01-01'
# @source http://www.safework.sa.gov.au/show_page.jsp?id=2483
12-24 18:00:
_name: 12-24
# @source https://www.legislation.sa.gov.au/LZ/C/A/HOLIDAYS%20ACT%201910.aspx
SA:
name: South Australia
zones:
- Australia/Adelaide
days:
easter: false
2nd monday in March:
name:
en: March public holiday
en: Adelaide Cup Day
12-24 19:00:
_name: 12-24
type: public
12-25 and if saturday then next monday if sunday then next tuesday: false
12-25 if saturday then next monday if sunday then next tuesday:
substitute: true
_name: 12-25
12-26 and if saturday then next monday if sunday then next tuesday: false
12-26 if saturday then next monday if sunday then next tuesday:
substitute: true
name: Proclamation Day
12-31 19:00:
_name: 12-31
type: public
# @source http://worksafe.tas.gov.au/laws/public_holidays
# @source https://www.legislation.tas.gov.au/view/html/inforce/current/act-2000-096
TAS:
name: Tasmania
zones:
- Australia/Hobart
days:
01-01 and if saturday,sunday then next monday: false
01-01 if saturday then next monday if sunday then next tuesday:
substitute: true
_name: 01-01
2nd monday in March:
name:
en: Eight Hours Day
easter -1:
type: observance
easter 2:
name:
en: Easter Tuesday
easter -1: false
easter: false
easter +2:
name: Easter Tuesday
type: optional
note: Public Service employees or contract dependent
regions:
H:
name: Hobart
days:
2nd monday in February:
name:
en: Royal Hobart Regatta
NH:
name: Non-Hobart
days:
1st monday in November:
name:
en: Recreation Day
# @source http://www.business.vic.gov.au/victorian-public-holidays-and-daylight-saving/victorian-public-holidays
1st monday in October: false
12-26 and if saturday then next monday if sunday then next tuesday: false
12-26 if saturday then next monday if sunday then next tuesday:
substitute: true
_name: 12-26
# @source https://www.legislation.vic.gov.au/search?q=holidays&page=1&sort%5B_score%5D=desc&sort%5Btitle_az%5D=asc&queryType=title
VIC:
name: Victoria
zones:
Expand All @@ -184,22 +190,20 @@ holidays:
2nd monday in March:
name:
en: Labour Day
easter:
type: public
2nd monday in June:
name:
en: Queen's Birthday
1st monday in October: false
# introduced in 2015-08
# @source http://www.gazette.vic.gov.au/gazette/Gazettes2015/GG2015S229.pdf
1st friday before 10-04:
# @source http://www.gazette.vic.gov.au/gazette/Gazettes2015
1st friday before October:
name:
en: Grand Final Friday
en: AFL Grand Final Friday
note: Date might differ as dependent on AFL schedule
regions:
M:
name: Melbourne
days:
1st tuesday in November:
name:
en: Melbourne Cup
# @source https://www.commerce.wa.gov.au/labour-relations/public-holidays-western-australia
1st tuesday in November:
name:
en: Melbourne Cup
# @source https://www.legislation.wa.gov.au/legislation/statutes.nsf/law_a639.html
WA:
name: Western Australia
zones:
Expand All @@ -209,14 +213,19 @@ holidays:
1st monday in March:
name:
en: Labour Day
easter -1:
type: observance
easter -1: false
easter: false
04-25: false
04-25 and if saturday,sunday then next monday:
substitute: true
name:
en: Anzac Day
1st monday in June:
name:
en: Western Australia Day
2nd monday in June: false
monday before 10-01:
monday before October:
name:
en: Queen's Birthday
note: Might be on a different day; is proclaimed by Governor

1st monday in October: false
6 changes: 3 additions & 3 deletions docs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,15 @@ Rule: `MM-DD if <weekday> then (next|previous) <weekday>`

### Substitute a holiday if date falls on a certain weekday

Rule: `substitute MM-DD if <weekday> then (next|previous) <weekday>`
Rule: `substitutes MM-DD if <weekday> then (next|previous) <weekday>`

If `substitute: true` is given then the translated string from `names.yaml/names/substitutes` will be appended to the name.
E.g. "Christmas" becomes "Christmas (substitute day)"

**Examples**:

- `substitute 03-02 if sunday then next monday` if March 2nd is on a Sunday then holiday will be on next Monday
- `substitute 04-13 if friday then previous monday` if Apri 13th is on a Friday then holiday falls to previous Monday
- `substitutes 03-02 if sunday then next monday` if March 2nd is on a Sunday then holiday will be on next Monday
- `substitutes 04-13 if friday then previous monday` if Apri 13th is on a Friday then holiday falls to previous Monday

### Observe the holiday as well as on a substitute day, if date falls on a certain weekday

Expand Down
33 changes: 8 additions & 25 deletions test/fixtures/AU-2015.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"start": "2015-04-04T13:00:00.000Z",
"end": "2015-04-05T14:00:00.000Z",
"name": "Easter Sunday",
"type": "observance",
"type": "public",
"_weekday": "Sun"
},
{
Expand All @@ -51,19 +51,10 @@
"date": "2015-04-25 00:00:00",
"start": "2015-04-24T14:00:00.000Z",
"end": "2015-04-25T14:00:00.000Z",
"name": "ANZAC Day",
"name": "Anzac Day",
"type": "public",
"_weekday": "Sat"
},
{
"date": "2015-04-27 00:00:00",
"start": "2015-04-26T14:00:00.000Z",
"end": "2015-04-27T14:00:00.000Z",
"name": "ANZAC Day (substitute day)",
"type": "public",
"substitute": true,
"_weekday": "Mon"
},
{
"date": "2015-06-08 00:00:00",
"start": "2015-06-07T14:00:00.000Z",
Expand All @@ -73,12 +64,12 @@
"_weekday": "Mon"
},
{
"date": "2015-12-24 00:00:00",
"start": "2015-12-23T13:00:00.000Z",
"end": "2015-12-24T13:00:00.000Z",
"name": "Christmas Eve",
"type": "observance",
"_weekday": "Thu"
"date": "2015-10-05 00:00:00",
"start": "2015-10-04T13:00:00.000Z",
"end": "2015-10-05T13:00:00.000Z",
"name": "Labour Day",
"type": "public",
"_weekday": "Mon"
},
{
"date": "2015-12-25 00:00:00",
Expand All @@ -104,13 +95,5 @@
"type": "public",
"substitute": true,
"_weekday": "Mon"
},
{
"date": "2015-12-31 00:00:00",
"start": "2015-12-30T13:00:00.000Z",
"end": "2015-12-31T13:00:00.000Z",
"name": "New Year's Eve",
"type": "observance",
"_weekday": "Thu"
}
]
Loading

0 comments on commit 2a7af6c

Please sign in to comment.