Skip to content

Commit 05b9718

Browse files
committed
docs: update spec
1 parent 87d73c3 commit 05b9718

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/specification.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Specification for `holidays.yaml`
22

3-
Version: 2.0.0
3+
Version: 2.1.0
44

55
This document describes the data contained within the files `holidays.yaml` and
66
`names.yaml`.
@@ -523,6 +523,25 @@ Where:
523523
- `09-22 if 09-21 is holiday` is September 22nd is public holiday only if September 21st is also a holiday
524524
- `09-22 if 09-21 and 09-23 is public holiday` is September 22nd is public holiday only if September 21st and September 23rd are public holidays
525525

526+
### Change to different weekday if date already falls on a holiday
527+
528+
Rule: `<rule> if is (<type>)? holiday then (<count>)? (next|previous) <weekday>`
529+
530+
Rule: `<rule> if is (<type>)? holiday then (<count>)? (next|previous) day (omit <weekdays>)?`
531+
532+
Where:
533+
- `<rule>` any rule
534+
- `<type>` public, bank, school, observance, optional (defaults to public if omitted)
535+
- `<count>` 1...31, 1st, 2nd, 3rd
536+
- `<weekday>` Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
537+
- `<weekdays>` Comma separated list of `<weekday>`
538+
539+
**Examples**:
540+
541+
- `Thursday after 04-02 if is observance holiday then next Thursday`
542+
- `03-01 and if Saturday, Sunday then next Monday if is holiday then 2nd next Tuesday since 2022`
543+
- `05-01 if is public holiday then 2nd next day omit Saturday, Sunday`
544+
526545
### Enabling a rule since or in certain years
527546

528547
> __Note:__ Use quotes around dates!

0 commit comments

Comments
 (0)