Skip to content

feat(recur): add byyearday property accessor to vRecur (#1851) - #2174

Open
RishabhIIITD wants to merge 1 commit into
PyCalendar:mainfrom
RishabhIIITD:feat/recur-byyearday-property
Open

RishabhIIITD wants to merge 1 commit into
PyCalendar:mainfrom
RishabhIIITD:feat/recur-byyearday-property

Conversation

@RishabhIIITD

Copy link
Copy Markdown

Description

This PR implements the byyearday property accessor on :class:~icalendar.prop.recur.recur.vRecur as part of the #1851 collaboration.

Per RFC 5545 Section 3.3.10:

  • BYYEARDAY specifies a list of days of the year. Valid values are between 1 and 366 or between -366 and -1 (the value 0 is forbidden).
  • If multiple values are given, they all are returned as a tuple of integers (tuple[int, ...]).
  • If missing or an empty list is present, () is returned.
  • Setting to None or an empty sequence deletes the value (del recur.byyearday).
  • The value 0 and values outside [-366..-1, 1..366] raise InvalidCalendar.
  • Non-integer types raise TypeError.

Implementation Checklist

  • return type is tuple[int, ...] based on vRecur.types
  • setting to None or an empty sequence deletes the value
  • del deletes the value
  • if multiple values are given, they all are returned
  • if an empty list is in there, () is returned
  • docstring with example values: >>> vRecur.from_ical("FREQ=YEARLY;BYYEARDAY=1,100,300").byyearday
  • docstring summarizes what this property is about
  • docstring shows the valid range (-366 to -1 and 1 to 366, 0 forbidden)
  • unit tests in src/icalendar/tests/prop/recur/test_byyearday.py
  • news fragment added: news/1851.feature.8

@github-actions

Copy link
Copy Markdown
Contributor

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

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.

1 participant