Skip to content

Add ical_value property to vWeekday#1379

Open
xxiaoxiong wants to merge 1 commit into
collective:mainfrom
xxiaoxiong:add-ical-value-vweekday
Open

Add ical_value property to vWeekday#1379
xxiaoxiong wants to merge 1 commit into
collective:mainfrom
xxiaoxiong:add-ical-value-vweekday

Conversation

@xxiaoxiong
Copy link
Copy Markdown

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

Changes

  • Added ical_value property to vWeekday (src/icalendar/prop/recur/weekday.py)
    • Returns: str - The weekday string value
    • Type hint: str
    • RFC reference: :rfc:5545#section-3.3.10
    • Includes comprehensive docstring with examples
    • Handles simple weekdays (MO, TU, etc.) and relative positions (2FR, -1SU)

Tests

  • Created test_vWeekday.py with 7 comprehensive test cases:
    • test_ical_value_simple_weekday - Tests simple weekday
    • test_ical_value_all_weekdays - Tests all 7 weekday abbreviations
    • test_ical_value_positive_relative - Tests positive relative position
    • test_ical_value_negative_relative - Tests negative relative position
    • test_ical_value_from_ical - Tests with parsed ical strings
    • test_ical_value_case_insensitive - Tests case handling
    • test_ical_value_with_plus_sign - Tests explicit plus sign
  • All tests pass: 7 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 string value
- Handles simple weekdays and relative positions
- Add comprehensive tests for ical_value (7 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 #32600667 | 📁 Comparing be53d25 against latest (7357cec)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant