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.
如标题所示,自定义序列化格式,我看到此前有许多issue需要一些自定义序列化逻辑的需求或是一些边界条件导致的bug,
但他们什么都做不了,只能等待Carbon下个版本增强或修复,
由此我希望能为Carbon添加自定义序列化函数,以满足不同需求,既能增强原有功能,也能在面对一些边界条件导致的bug时,使用者可以通过自定义序列化来手动解决,而不是等待Carbon修复
此pr不会破坏原有功能,只是增强且兼容。
目前只实现了Carbon,DateTime,Time 三种类型的自定义格式化逻辑
如果您认为不需要此功能的话,可以关掉
如果需要的话,我会补齐剩下的类型,并添加测试