Skip to content

Commit

Permalink
Merge pull request #426 from peopledoc/thanksgiving-day-documentation
Browse files Browse the repository at this point in the history
Fix Advanced usage documentation about Thanksgiving Day
  • Loading branch information
brunobord committed Nov 22, 2019
2 parents c3bb8e8 + b3cfe55 commit 9cf168c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Added Geneva calendar by @cw-intellineers (#420)
- Bugfix for USA: Fixed incorrect implementation for Thanksgiving Friday, thx @deveshvar (#422).
- Fix Advanced usage documentation about Thanksgiving Day.

## v7.1.0 (2019-11-15)

Expand Down
10 changes: 5 additions & 5 deletions docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ datetime.date(2018, 7, 9)

**WARNING**: this function doesn't take into account the existing holidays in the calendar. If you need this, use the ``add_working_days()`` function as described in the [Basic usage document](basic.md).

## Find the 4th Friday in November
## Find the 4th Thursday in November

That's a puzzling question that we needed to address when we had to implement United States of America holidays calendars. Thanksgiving day, for example, which is on the 4th Friday in November... and many others, are defined as:
That's a puzzling question that we needed to address when we had to implement United States of America holidays calendars. Thanksgiving day, for example, which is on the 4th Thursday in November (Thanksgiving Friday is the day after this thursday)... and many others, are defined as:

> the ``nth`` ``Weekday name`` of the month of ``Month name``
Expand All @@ -35,10 +35,10 @@ Or even better for Election day, which is:
We've got you covered with static methods in the core ``Calendar`` class.

```python
>>> from workalendar.core import Calendar, FRI
>>> Calendar.get_nth_weekday_in_month(2018, 11, FRI) # by default, find the first
>>> from workalendar.core import Calendar, THU
>>> Calendar.get_nth_weekday_in_month(2018, 11, THU) # by default, find the first
datetime.date(2018, 11, 2)
>>> Calendar.get_nth_weekday_in_month(2018, 11, FRI, 4) # Thanksgiving
>>> Calendar.get_nth_weekday_in_month(2018, 11, THU, 4) # Thanksgiving
datetime.date(2018, 11, 23)
```

Expand Down

0 comments on commit 9cf168c

Please sign in to comment.