Skip to content

Commit 116b055

Browse files
Doc : Improve last_modified doctsring (#1419)
* Mejora en la documentacion de last_modified en componentes * Corregir indentación * changelog * user * Changes * Create a unique filename across open PRs and existing files * fix example * fix errors * fix ruff * fix component * Delete news/1244.documentation * Revise vBoolean docstring with detailed description Updated the docstring for vBoolean with a Pythonic description, parsing behavior, conformance reference, and example. * Update src/icalendar/cal/component.py Co-authored-by: Steve Piercy <web@stevepiercy.com> * Update src/icalendar/cal/component.py Co-authored-by: Steve Piercy <web@stevepiercy.com> * Update src/icalendar/cal/component.py Co-authored-by: Steve Piercy <web@stevepiercy.com> * Update component.py Co-authored-by: Steve Piercy <web@stevepiercy.com> --------- Co-authored-by: Steve Piercy <web@stevepiercy.com>
1 parent b0bbea4 commit 116b055

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

news/1244.documentation.2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improved the :attr:`~icalendar.cal.component.Component.LAST_MODIFIED` docstring to a clearer Pythonic docstring. Assisting tool: Claude Haiku 4.5 @valemm13

src/icalendar/cal/component.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -686,20 +686,26 @@ def __eq__(self, other):
686686
property.
687687
""",
688688
)
689+
689690
LAST_MODIFIED = single_utc_property(
690691
"LAST-MODIFIED",
691-
"""RFC 5545:
692+
"""The date and time when a calendar component was last modified.
692693
693-
Purpose: This property specifies the date and time that the
694-
information associated with the calendar component was last
695-
revised in the calendar store.
694+
This property is commonly used to track revisions to calendar
695+
components such as VEVENT, VTODO, VJOURNAL, and VTIMEZONE.
696696
697-
Note: This is analogous to the modification date and time for a
698-
file in the file system.
697+
Example:
698+
Set the LAST-MODIFIED property of an event to a UTC time.
699699
700-
Conformance: This property can be specified in the "VEVENT",
701-
"VTODO", "VJOURNAL", or "VTIMEZONE" calendar components.
702-
""",
700+
.. code-block:: pycon
701+
702+
>>> from datetime import datetime, timezone
703+
>>> from icalendar import Event
704+
>>> event = Event()
705+
>>> event.last_modified = datetime(2026, 5, 31, 23, 52, 45, tzinfo=timezone.utc)
706+
>>> event.last_modified
707+
datetime.datetime(2026, 5, 31, 23, 52, 45, tzinfo=ZoneInfo(key='UTC'))
708+
""",
703709
)
704710

705711
@property

0 commit comments

Comments
 (0)