Skip to content

Commit 6ce3a81

Browse files
authored
Merge pull request #179 from kuzmoyev/dev
Add Earth Hour example to recurrence docs.
2 parents 95af6c7 + 3fb6c07 commit 6ce3a81

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/source/recurrence.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,20 @@ auxiliary classes and objects:
6161
from gcsa.recurrence import SECONDLY, MINUTELY, HOURLY, \
6262
DAILY, WEEKLY, MONTHLY, YEARLY
6363
64+
`Earth Hour`_, which occurs on the last Saturday of March every year:
65+
66+
.. code-block:: python
67+
68+
from datetime import datetime
69+
70+
r = Recurrence.rule(freq=MONTHLY, interval=12, by_week_day=SA(-1))
71+
start = datetime(year=2024, month=3, day=23, hour=20, minute=30)
72+
event = Event("Earth hour", start=start, recurrence=r)
73+
74+
event = gc.add_event(event)
6475
6576
66-
Examples were taken from the `Internet Calendaring and Scheduling Core Object Specification (iCalendar)`_
77+
Following examples were taken from the `Internet Calendaring and Scheduling Core Object Specification (iCalendar)`_
6778
and adapted to ``gcsa``.
6879

6980

@@ -286,3 +297,4 @@ Thursday, for the next 3 months`:
286297
287298
288299
.. _`Internet Calendaring and Scheduling Core Object Specification (iCalendar)`: https://tools.ietf.org/html/rfc5545#section-3.8.5
300+
.. _`Earth Hour`: https://www.earthhour.org/

0 commit comments

Comments
 (0)