Skip to content

feat: improve DateTime handling with better error messages#6

Open
chenzihui222 wants to merge 1 commit into
knowecon:mainfrom
chenzihui222:feat/improve-datetime-handling
Open

feat: improve DateTime handling with better error messages#6
chenzihui222 wants to merge 1 commit into
knowecon:mainfrom
chenzihui222:feat/improve-datetime-handling

Conversation

@chenzihui222

Copy link
Copy Markdown

增强 DateTime 解析的健壮性,支持多种格式并提供更好的错误消息。\n\n## Changes\n- 支持 DateTime 结构体(自动转为UTC)\n- 支持带时区的 ISO8601 字符串\n- 支持 Unix 时间戳(毫秒)\n- 无效输入时有描述性错误消息\n- 添加 ensure_utc/1 辅助函数

Enhance datetime parsing in Card and ReviewLog modules:

- Support DateTime structs, ISO8601 strings, and unix timestamps
- Add proper error handling with descriptive messages
- Automatically convert non-UTC datetimes to UTC
- Add ensure_utc/1 helper function

This improves robustness when deserializing data from various sources
and provides better developer experience with clear error messages.
@chenzihui222 chenzihui222 marked this pull request as ready for review March 9, 2026 11:30
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