Skip to content

Commit

Permalink
Revert "Remove DTSTAMP from VTIMEZONE"
Browse files Browse the repository at this point in the history
This reverts commit 4f68b9c.
  • Loading branch information
allenporter committed Apr 21, 2024
1 parent 4f68b9c commit 4b612fe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ical/timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ class Timezone(ComponentModel):
sub-component.
"""

dtstamp: Union[datetime.datetime, datetime.date] = Field(
default_factory=lambda: dtstamp_factory()
)
"""Last revision date."""

tz_id: str = Field(alias="tzid")
"""An identifier for this Timezone, unique within a calendar."""

Expand Down
4 changes: 4 additions & 0 deletions tests/__snapshots__/test_calendar_stream.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
}),
}),
]),
'dtstamp': '2023-03-13T01:12:29',
'standard': list([
dict({
'dtstart': '2010-11-07T02:00:00',
Expand Down Expand Up @@ -1026,6 +1027,7 @@
}),
}),
]),
'dtstamp': '2022-08-11T06:12:12',
'last_modified': '2005-08-09T05:00:00+00:00',
'standard': list([
dict({
Expand Down Expand Up @@ -1276,6 +1278,7 @@
SEQUENCE:0
END:VEVENT
BEGIN:VTIMEZONE
DTSTAMP:20230313T011229
TZID:America/Example
BEGIN:STANDARD
DTSTART:20101107T020000
Expand Down Expand Up @@ -1785,6 +1788,7 @@
PRODID:-//ABC Corporation//NONSGML My Product//EN
VERSION:2.0
BEGIN:VTIMEZONE
DTSTAMP:20220811T061212
TZID:America/New_York
LAST-MODIFIED:20050809T050000Z
BEGIN:STANDARD
Expand Down
2 changes: 2 additions & 0 deletions tests/test_timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def test_from_tzif_timezoneinfo_with_dst(
PRODID:-//example//1.2.3
VERSION:2.0
BEGIN:VTIMEZONE
DTSTAMP:20220822T123000
TZID:America/New_York
BEGIN:STANDARD
DTSTART:20101107T020000
Expand Down Expand Up @@ -155,6 +156,7 @@ def test_from_tzif_timezoneinfo_fixed_offset(
PRODID:-//example//1.2.3
VERSION:2.0
BEGIN:VTIMEZONE
DTSTAMP:20220822T123000
TZID:Asia/Tokyo
BEGIN:STANDARD
DTSTART:20100101T000000
Expand Down
3 changes: 2 additions & 1 deletion tests/testdata/datetime_vtimezone.ics
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CREATED:20230313T011226
SEQUENCE:0
END:VEVENT
BEGIN:VTIMEZONE
DTSTAMP:20230313T011229
TZID:America/Example
BEGIN:STANDARD
DTSTART:20101107T020000
Expand All @@ -27,4 +28,4 @@ RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
TZNAME:PDT
END:DAYLIGHT
END:VTIMEZONE
END:VCALENDAR
END:VCALENDAR
3 changes: 2 additions & 1 deletion tests/testdata/timezone_ny.ics
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ BEGIN:VCALENDAR
PRODID:-//ABC Corporation//NONSGML My Product//EN
VERSION:2.0
BEGIN:VTIMEZONE
DTSTAMP:20220811T061212
TZID:America/New_York
LAST-MODIFIED:20050809T050000Z
BEGIN:DAYLIGHT
Expand Down Expand Up @@ -54,4 +55,4 @@ TZOFFSETTO:-0500
TZNAME:EST
END:STANDARD
END:VTIMEZONE
END:VCALENDAR
END:VCALENDAR

0 comments on commit 4b612fe

Please sign in to comment.