Objects built from arguments have a TZID but no VTIMEZONE

未关闭
#849 14 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@ivenos 已经在做这个了。

开始于 2026年11月7日。

  • #852 来自 @ivenos —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

Start by reading create_ical() and complete(rrule_mode="thisandfuture"), the two entry points named in the issue, and inspect how timezone components and recurrence rules are handled. Check the existing tests for add_event, add_todo and completion behavior, then run them with a non-UTC timezone and a calendar containing VTIMEZONE. Done means the timezone data is included and read correctly across the year, while completion works when VTIMEZONE appears before or after the task.

由索引模型根据 Issue 内容生成。

描述

add_event(dtstart=...) or add_todo(due=...) with a time zone other than UTC writes DTSTART;TZID=Europe/Prague:... without a VTIMEZONE, which RFC 5545 section 3.6.5 requires. Home Assistant creates its events this way, and a user there sees them shifted by the UTC offset in Synology Calendar (https://github.com/home-assistant/core/issues/172990).

I have a fix that adds the missing VTIMEZONE in create_ical(), built with icalendar's Timezone.from_tzid(). One catch: icalendar writes the transitions as one RDATE list and vobject 0.9.9 only reads the first value, so vobject_instance would be an hour off for half of the year. The fix writes one RDATE per line. It also has to touch complete(rrule_mode="thisandfuture"), which takes the first component as the task: it fails with KeyError: 'RRULE' when a VTIMEZONE comes first, as in most tasks from other clients, and marks a VTIMEZONE after the task as completed instead.

The fix was written with Claude and tested against Radicale, Xandikos, Baikal, Nextcloud and SOGo. OK to send it as a PR?

主要语言
Python
星标
412
派生
113
平均合并
9 小时 21 分钟
30 天内合并 PR
77

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python-caldav/caldav 的其他 Issue

查看 python-caldav/caldav 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。