Skip to content

feat(todo): add COMPLETED and completed property accessors (#1797) - #2144

Open
RishabhIIITD wants to merge 2 commits into
PyCalendar:mainfrom
RishabhIIITD:feat/todo-completed-property
Open

RishabhIIITD wants to merge 2 commits into
PyCalendar:mainfrom
RishabhIIITD:feat/todo-completed-property

Conversation

@RishabhIIITD

Copy link
Copy Markdown

Description

This PR implements the COMPLETED and completed property accessors on the Todo (VTODO) component per :rfc:5545#section-3.8.2.1, resolving #1797.

Summary of Changes:

  1. Property Accessors: Added COMPLETED = single_utc_property("COMPLETED", ...) on Todo along with the lowercase completed property getter, setter, and deleter.
  2. Constructor Update: Added completed: date | datetime | None = None parameter and assignment in Todo.new(...).
  3. RFC Conformance: Verified per RFC 5545 Section 3.8.2.1 that COMPLETED is specified only for VTODO calendar components.
  4. Date to UTC Datetime: Confirmed that COMPLETED:20070501 and COMPLETED;VALUE=DATE:20070501 are properly converted into UTC datetime.
  5. Tests & Fixtures:
    • Added issue_1797_completed_date.ics and issue_1797_completed_datetime.ics to src/icalendar/tests/todos/.
    • Added comprehensive tests in src/icalendar/tests/test_issue_1797_todo_completed.py covering getter/setter/deleter, fixture loading, serialization, and absence on other components.
  6. News Fragment: Added news/+1797-todo-completed.feature.

Closes #1797

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @RishabhIIITD! A maintainer will review it shortly.

@SemTiOne

Copy link
Copy Markdown
Contributor

Thanks for the contribution. However, there's already an open PR (#2023) for this issue. Would you please review that PR and provide some feedback to the author?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Todo.COMPLETED

2 participants