Skip to content

Add ical_value property to vDuration#1377

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

Add ical_value property to vDuration#1377
xxiaoxiong wants to merge 1 commit into
collective:mainfrom
xxiaoxiong:add-ical-value-vduration

Conversation

@xxiaoxiong
Copy link
Copy Markdown

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

Changes

  • Added ical_value property to vDuration (src/icalendar/prop/dt/duration.py)
    • Returns: timedelta - The duration as a timedelta object
    • Type hint: timedelta
    • RFC reference: :rfc:5545#section-3.3.6
    • Includes comprehensive docstring with examples

Tests

  • Created test_vDuration.py with 6 comprehensive test cases:
    • test_ical_value_basic - Tests basic timedelta return
    • test_ical_value_components - Tests days/seconds components
    • test_ical_value_from_ical - Tests with parsed ical strings
    • test_ical_value_negative - Tests negative durations
    • test_ical_value_zero - Tests zero duration
    • test_ical_value_from_string - Tests vDuration created from string
  • All tests pass: 6 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 timedelta object
- Add comprehensive tests for ical_value (6 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 #32600448 | 📁 Comparing 14f429b 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