Skip to content

Commit

Permalink
Merge pull request #179 from kuzmoyev/dev
Browse files Browse the repository at this point in the history
Add Earth Hour example to recurrence docs.
  • Loading branch information
kuzmoyev authored Mar 19, 2024
2 parents 95af6c7 + 3fb6c07 commit 6ce3a81
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/source/recurrence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,20 @@ auxiliary classes and objects:
from gcsa.recurrence import SECONDLY, MINUTELY, HOURLY, \
DAILY, WEEKLY, MONTHLY, YEARLY
`Earth Hour`_, which occurs on the last Saturday of March every year:

.. code-block:: python
from datetime import datetime
r = Recurrence.rule(freq=MONTHLY, interval=12, by_week_day=SA(-1))
start = datetime(year=2024, month=3, day=23, hour=20, minute=30)
event = Event("Earth hour", start=start, recurrence=r)
event = gc.add_event(event)
Examples were taken from the `Internet Calendaring and Scheduling Core Object Specification (iCalendar)`_
Following examples were taken from the `Internet Calendaring and Scheduling Core Object Specification (iCalendar)`_
and adapted to ``gcsa``.


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

0 comments on commit 6ce3a81

Please sign in to comment.