ATProtoKit
ATProtoKit copied to clipboard
[Feature Enhancement]: Unify and Improve `@DateFormatting`
Summary
Create a solution where the @DateFormatting property wrapper is able to handle all of the requirements without the need to create custom implementations.
Pain points
At this time, there are two property wrappers: @DateFormatting and DateFormattingOptional. While their current implementations work, there are a couple of issues:
- Having one for
Dateand another forDate?can be a little bit confusing and can possibly lead to situations where bugs can occur. - The initializers currently have an unconventional way of being initialized, where the property must begin with an underscore before the name of the variable.
- The decoding and encoding methods must be implemented.
A solution is needed to fix the latter two, while the first issue can be solved by merging @DateFormatting and @DateFormattingOptional into one, unified @DateFormatting property wrapper.
Considered Alternatives
No response
Is this a breaking change?
No
Library Examples
No response
Additional Context
The tasks include:
- [ ] Add the
@DateFormattingOptional-related implementations into@DateFormatting. - [ ] Tweak the code so the standard initializer is no longer needed to be initialized.
- [ ] Tweak the code so that creating a customized decoding method is no longer required.
- [ ] Tweak the code so that creating a customized encoding method is no longer required.