Skip to content

Commit 47e11d7

Browse files
authored
Update examples to reflect recent holidays changes (#1978)
1 parent 9b00249 commit 47e11d7

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

docs/source/examples.rst

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ Let's print out the holidays in 2014 specific to California, USA:
5454
2014-01-20 Martin Luther King Jr. Day
5555
2014-02-15 Susan B. Anthony Day
5656
2014-02-17 Washington's Birthday
57-
2014-03-31 César Chávez Day
57+
2014-03-31 Cesar Chavez Day
5858
2014-05-26 Memorial Day
5959
2014-07-04 Independence Day
6060
2014-09-01 Labor Day
61-
2014-10-13 Columbus Day
6261
2014-11-11 Veterans Day
6362
2014-11-27 Thanksgiving
63+
2014-11-28 Day After Thanksgiving
6464
2014-12-25 Christmas Day
6565
6666
So far we've only checked holidays in 2014 so that's the only year the Holidays
@@ -139,15 +139,14 @@ To change the language translation, you can set the language explicitly.
139139
>>> for dt, name in sorted(holidays.ES(years=2023, language="es").items()):
140140
>>> print(dt, name)
141141
2023-01-06 Epifanía del Señor
142-
2023-04-06 Jueves Santo
143142
2023-04-07 Viernes Santo
144-
2023-05-01 Día del Trabajador
143+
2023-05-01 Fiesta del Trabajo
145144
2023-08-15 Asunción de la Virgen
146-
2023-10-12 Día de la Hispanidad
145+
2023-10-12 Fiesta Nacional de España
147146
2023-11-01 Todos los Santos
148147
2023-12-06 Día de la Constitución Española
149-
2023-12-08 La Inmaculada Concepción
150-
2023-12-25 Navidad
148+
2023-12-08 Inmaculada Concepción
149+
2023-12-25 Natividad del Señor
151150
152151
Holiday categories support
153152
--------------------------
@@ -165,21 +164,20 @@ To get a list of other categories holidays (for countries that support them):
165164
>>> print(dt, name)
166165
2023-01-01 New Year's Day
167166
2023-04-07 Good Friday
168-
2023-04-09 Easter
167+
2023-04-09 Easter Sunday
169168
2023-04-10 Easter Monday
170169
2023-05-01 Labor Day
171170
2023-05-18 Ascension Day
172171
2023-05-19 Friday after Ascension Day
173172
2023-05-28 Whit Sunday
174173
2023-05-29 Whit Monday
175174
2023-07-21 National Day
176-
2023-08-15 Assumption of Mary
175+
2023-08-15 Assumption Day
177176
2023-11-01 All Saints' Day
178177
2023-11-11 Armistice Day
179178
2023-12-25 Christmas Day
180179
2023-12-26 Bank Holiday
181180
182-
183181
Date from holiday name
184182
----------------------
185183

@@ -190,10 +188,10 @@ with case insensitive check):
190188
.. code-block:: python
191189
192190
>>> us_holidays = holidays.UnitedStates(years=2020)
193-
>>> us_holidays.get_named('day')
191+
>>> sorted(us_holidays.get_named('day'))
194192
[datetime.date(2020, 1, 1), datetime.date(2020, 1, 20),
195193
datetime.date(2020, 2, 17), datetime.date(2020, 5, 25),
196-
datetime.date(2020, 7, 4), datetime.date(2020, 7, 3),
194+
datetime.date(2020, 7, 3), datetime.date(2020, 7, 4),
197195
datetime.date(2020, 9, 7), datetime.date(2020, 10, 12),
198196
datetime.date(2020, 11, 11), datetime.date(2020, 12, 25)]
199197
@@ -229,9 +227,7 @@ holidays using the built-in :py:func:`sum` function:
229227
230228
>>> a = sum([holidays.CA(subdiv=x) for x in holidays.CA.subdivisions])
231229
>>> a.subdiv
232-
['AB', 'BC', 'MB', 'NB', 'NL', 'NS', 'NT', 'NU', 'ON', 'PE', 'QC', 'SK',
233-
'YU']
234-
230+
['AB', 'BC', 'MB', 'NB', 'NL', 'NS', 'NT', 'NU', 'ON', 'PE', 'QC', 'SK', 'YT']
235231
236232
Creating custom holidays (or augmenting existing ones with private ones)
237233
------------------------------------------------------------------------
@@ -308,7 +304,6 @@ pairs, a list of dates, or even singular date/string/timestamp objects:
308304
>>> custom_holidays.append(['2015-01-01', '07/04/2015'])
309305
>>> custom_holidays.append(date(2015, 12, 25))
310306
311-
312307
Add years to an existing Holiday object
313308
---------------------------------------
314309

@@ -323,8 +318,6 @@ holiday object:
323318
# to add new years of holidays to the object:
324319
>>> us_holidays.update(country_holidays('US', years=2021))
325320
326-
327-
328321
Other ways to specify the country
329322
---------------------------------
330323

0 commit comments

Comments
 (0)