-
Notifications
You must be signed in to change notification settings - Fork 194
ISO8601 DateComponents format style #1209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci test |
77493e1
to
2bf9583
Compare
2bf9583
to
025bf8c
Compare
@swift-ci test |
@available(FoundationPreview 6.2, *) | ||
extension DateComponents { | ||
/// Options for generating and parsing string representations of dates following the ISO 8601 standard. | ||
public struct ISO8601FormatStyle : Sendable, Codable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposal has it conform to Hashable
as well. Is that missing here?
|
||
@available(FoundationPreview 6.2, *) | ||
public extension FormatStyle where Self == DateComponents.ISO8601FormatStyle { | ||
static var iso8601: Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposal has it named iso8601Components
. I think it's ok to call it iso8601
here (unlike the one below for RegexComponent
, but not sure what you ended up deciding on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this one as iso8601 and made the regex one “components” (and also made that consistent with HTTP)
@swift-ci test |
* ISO8601 DateComponents style * Add Hashable to ISO8601FormatStyle
Add an ISO8601 components format style. See pitch thread.
Resolves:
#323
#967
#1159