Skip to content

Add ical_value property to vMonth#1381

Closed
xxiaoxiong wants to merge 1 commit into
collective:mainfrom
xxiaoxiong:add-ical-value-vmonth
Closed

Add ical_value property to vMonth#1381
xxiaoxiong wants to merge 1 commit into
collective:mainfrom
xxiaoxiong:add-ical-value-vmonth

Conversation

@xxiaoxiong
Copy link
Copy Markdown

This PR adds the ical_value property to vMonth, contributing to Issue #876.

Changes

  • Added ical_value property to vMonth (src/icalendar/prop/recur/month.py)
    • Returns: int - The month number
    • Type hint: int
    • RFC reference: :rfc:5545#section-3.3.10 and :rfc:7529
    • Includes comprehensive docstring with examples
    • Supports both regular months (1-12) and leap months (e.g., "5L")
    • The int value excludes the "L" suffix; use .leap property to check leap status

Tests

  • Created test_vMonth.py with 8 comprehensive test cases:
    • test_ical_value_basic - Tests basic month number
    • test_ical_value_all_months - Tests all 12 months
    • test_ical_value_leap_month - Tests leap month (RFC 7529)
    • test_ical_value_from_string - Tests string input
    • test_ical_value_from_ical - Tests parsed ical strings
    • test_ical_value_january - Tests January (1)
    • test_ical_value_december - Tests December (12)
    • test_ical_value_arithmetic - Tests arithmetic operations
  • All tests pass: 8 passed

Quality Checks

  • Add type hint
  • Add docstring with RFC reference
  • Add tests for all code paths
  • Pass ruff format check
  • Pass ruff lint check
  • All tests pass

Relates to #876

- Add ical_value property with type hints and docstring
- Returns the underlying int value (month number)
- Supports both regular and leap months (RFC 7529)
- Add comprehensive tests for ical_value (8 test cases)
- All tests pass
- Code formatted with ruff

Relates to collective#876
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 icalendar | 🛠️ Build #32600733 | 📁 Comparing cc6308f against latest (7357cec)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

@stevepiercy stevepiercy added the ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding. label May 20, 2026
@stevepiercy
Copy link
Copy Markdown
Member

@xxiaoxiong thank you for opening this PR. Because you haven't responded to the reviews and CI failures, I'm closing all of your PRs to let other contributors know that they are free to work on it. You're welcome to address our comments, resolve the matters, and reopen your pull request at any time, specifically to address the question of AI usage and add a change log, per Contribute. Thank you!

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

Labels

ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants