feat: improve DateTime handling with better error messages#6
Open
chenzihui222 wants to merge 1 commit into
Open
feat: improve DateTime handling with better error messages#6chenzihui222 wants to merge 1 commit into
chenzihui222 wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
增强 DateTime 解析的健壮性,支持多种格式并提供更好的错误消息。\n\n## Changes\n- 支持 DateTime 结构体(自动转为UTC)\n- 支持带时区的 ISO8601 字符串\n- 支持 Unix 时间戳(毫秒)\n- 无效输入时有描述性错误消息\n- 添加 ensure_utc/1 辅助函数