From e11534dc24e4942820496a60f6d379626428cce9 Mon Sep 17 00:00:00 2001 From: Dialca Date: Thu, 22 Oct 2026 20:31:33 -0300 Subject: [PATCH 1/7] feat: add ical_value property to vUTCOffset (#876) --- news/876.feature | 1 + src/icalendar/prop/dt/utc_offset.py | 5 +++++ src/icalendar/tests/prop/test_unit.py | 5 +++++ 3 files changed, 11 insertions(+) create mode 100644 news/876.feature diff --git a/news/876.feature b/news/876.feature new file mode 100644 index 000000000..5569e9696 --- /dev/null +++ b/news/876.feature @@ -0,0 +1 @@ +Created an :attr:`~icalendar.prop.dt.utc_offset.vUTCOffset.ical_value` property for the :class:`~icalendar.prop.dt.utc_offset.vUTCOffset` component. @GabrielGervasio \ No newline at end of file diff --git a/src/icalendar/prop/dt/utc_offset.py b/src/icalendar/prop/dt/utc_offset.py index d4bb48497..4097d66e4 100644 --- a/src/icalendar/prop/dt/utc_offset.py +++ b/src/icalendar/prop/dt/utc_offset.py @@ -85,6 +85,11 @@ def __init__(self, td: timedelta, /, params: dict[str, Any] | None = None) -> No self.td = td self.params = Parameters(params) + @property + def ical_value(self) -> timedelta: + """UTC offset as a :class:`datetime.timedelta` according to :rfc:`5545#section-3.3.14`.""" + return self.td + def to_ical(self) -> str: """Return the ical representation.""" return self.format("") diff --git a/src/icalendar/tests/prop/test_unit.py b/src/icalendar/tests/prop/test_unit.py index 5a7760599..0db9fc61d 100644 --- a/src/icalendar/tests/prop/test_unit.py +++ b/src/icalendar/tests/prop/test_unit.py @@ -299,6 +299,11 @@ def test_prop_vUTCOffset(self): assert vUTCOffset(timedelta(hours=1, minutes=30)).to_ical() == "+0130" + # Test ical_value + assert vUTCOffset(timedelta(hours=2)).ical_value == timedelta(hours=2) + + assert vUTCOffset(timedelta(hours=-5)).ical_value == timedelta(hours=-5) + # Support seconds assert ( vUTCOffset(timedelta(hours=1, minutes=30, seconds=7)).to_ical() == "+013007" From 97a00817d9e9fab228bcbeec0022d811a73c6833 Mon Sep 17 00:00:00 2001 From: Dialca Date: Thu, 22 Oct 2026 20:41:00 -0300 Subject: [PATCH 2/7] style: format test_unit.py --- src/icalendar/tests/prop/test_unit.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/icalendar/tests/prop/test_unit.py b/src/icalendar/tests/prop/test_unit.py index 0db9fc61d..b85c8994c 100644 --- a/src/icalendar/tests/prop/test_unit.py +++ b/src/icalendar/tests/prop/test_unit.py @@ -301,7 +301,6 @@ def test_prop_vUTCOffset(self): # Test ical_value assert vUTCOffset(timedelta(hours=2)).ical_value == timedelta(hours=2) - assert vUTCOffset(timedelta(hours=-5)).ical_value == timedelta(hours=-5) # Support seconds From f1fc6582e167dbc7b151451962ab3769b3d5528f Mon Sep 17 00:00:00 2001 From: Gabriel Gervasio de Santana <114101356+GabrielGervasio@users.noreply.github.com> Date: Fri, 23 Oct 2026 21:44:10 -0300 Subject: [PATCH 3/7] Update news/876.feature Co-authored-by: Nicco Kunzmann --- news/876.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/876.feature b/news/876.feature index 5569e9696..0fcec2c04 100644 --- a/news/876.feature +++ b/news/876.feature @@ -1 +1 @@ -Created an :attr:`~icalendar.prop.dt.utc_offset.vUTCOffset.ical_value` property for the :class:`~icalendar.prop.dt.utc_offset.vUTCOffset` component. @GabrielGervasio \ No newline at end of file +Created the :attr:`vUTCOffset.ical_value ` property. @GabrielGervasio \ No newline at end of file From bd7c0991ea556e20140e1768c2d8bb99014de07d Mon Sep 17 00:00:00 2001 From: Gabriel Gervasio de Santana <114101356+GabrielGervasio@users.noreply.github.com> Date: Fri, 23 Oct 2026 21:44:26 -0300 Subject: [PATCH 4/7] Update src/icalendar/prop/dt/utc_offset.py Co-authored-by: Nicco Kunzmann --- src/icalendar/prop/dt/utc_offset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/icalendar/prop/dt/utc_offset.py b/src/icalendar/prop/dt/utc_offset.py index 4097d66e4..78aa3174a 100644 --- a/src/icalendar/prop/dt/utc_offset.py +++ b/src/icalendar/prop/dt/utc_offset.py @@ -87,7 +87,7 @@ def __init__(self, td: timedelta, /, params: dict[str, Any] | None = None) -> No @property def ical_value(self) -> timedelta: - """UTC offset as a :class:`datetime.timedelta` according to :rfc:`5545#section-3.3.14`.""" + """UTC offset as a :class:`~datetime.timedelta` according to :rfc:`5545#section-3.3.14`.""" return self.td def to_ical(self) -> str: From 3f082bca28c566030d74c087f31eb1605669a54c Mon Sep 17 00:00:00 2001 From: Gabriel Gervasio de Santana <114101356+GabrielGervasio@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:40:33 -0300 Subject: [PATCH 5/7] Add new feature file 876.featureUTCO --- news/{876.feature => 876.featureUTCO} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename news/{876.feature => 876.featureUTCO} (52%) diff --git a/news/876.feature b/news/876.featureUTCO similarity index 52% rename from news/876.feature rename to news/876.featureUTCO index 0fcec2c04..4668c24d2 100644 --- a/news/876.feature +++ b/news/876.featureUTCO @@ -1 +1 @@ -Created the :attr:`vUTCOffset.ical_value ` property. @GabrielGervasio \ No newline at end of file +Created the :attr:`vUTCOffset.ical_value ` property. @GabrielGervasio From dd4fb8038272a69929b523ef4aa58a8515999862 Mon Sep 17 00:00:00 2001 From: Gabriel Gervasio de Santana <114101356+GabrielGervasio@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:59:13 -0300 Subject: [PATCH 6/7] Rename 876.featureUTCO to 876.feature1 --- news/{876.featureUTCO => 876.feature1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{876.featureUTCO => 876.feature1} (100%) diff --git a/news/876.featureUTCO b/news/876.feature1 similarity index 100% rename from news/876.featureUTCO rename to news/876.feature1 From 1957ff7f32aba92fe94167a83995b13fbb94cd3d Mon Sep 17 00:00:00 2001 From: Gabriel Gervasio de Santana <114101356+GabrielGervasio@users.noreply.github.com> Date: Tue, 17 Nov 2026 21:02:01 -0300 Subject: [PATCH 7/7] Rename news/876.feature1 to news/news/876.feature.1 --- news/{876.feature1 => news/876.feature.1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{876.feature1 => news/876.feature.1} (100%) diff --git a/news/876.feature1 b/news/news/876.feature.1 similarity index 100% rename from news/876.feature1 rename to news/news/876.feature.1