Skip to content
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

Adopt AnyDateFormatter from Codextended #109

Closed

Conversation

addisonwebb
Copy link

This PR is dependent on Codextended PR #15. This draft PR will be updated to point to the new version of Codextended once that PR is merged and a new release is tagged.

This PR aims to solve the same issue as #77 and was inspired by @dpfannenstiel.

Why

As a website developer, I would like to use dates formatted according to the ISO 8601 standard.

Problem

Currently, a developer may specify a custom date formatter that is a DateFormatter. This solution prevents the use of ISO8601DateFormatter since it inherits directly from Formatter instead of DateFormatter.

Solution

This change adopts AnyDateFormatter from Codextended. This allows you to use ether DateFormatter or ISO8601DateFormatter as the PublishingContext.dateFormatter.

.step(named: "Use ISO 8601 Date Formatter") { context in
    context.dateFormatter = ISO8601DateFormatter()
}

This change should be the minimal set of changes required to support ISO8601DateFormatter as an option for developers. It should not introduce any breaking changes for current Publish users.

@addisonwebb
Copy link
Author

@JohnSundell here is a friendly ping to let you know that I am interested in getting this PR merged. I am available to address any feedback you might have.

Thanks!

@@ -18,7 +18,7 @@ let package = Package(
.package(name: "Ink", url: "https://github.com/johnsundell/ink.git", from: "0.2.0"),
.package(name: "Plot", url: "https://github.com/johnsundell/plot.git", from: "0.4.0"),
.package(name: "Files", url: "https://github.com/johnsundell/files.git", from: "4.0.0"),
.package(name: "Codextended", url: "https://github.com/johnsundell/codextended.git", from: "0.1.0"),
.package(name: "Codextended", url: "https://github.com/addisonwebb/codextended.git", .branch("update-any-date-formatter")),
Copy link
Author

@addisonwebb addisonwebb May 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and the Package.resolved file) will be updated once the Codextended PR is merged. JohnSundell/Codextended#15

@addisonwebb
Copy link
Author

@JohnSundell Would you have a half hour to review these PRs sometime soon? It would be nice to get this change merged into the main repo so I can stop pointing to my fork. Let me know if I can help in any way. Thanks!

@addisonwebb
Copy link
Author

@JohnSundell I just saw you tagged a new version for this library. I just want to bring this PR to your attention one last time to see if it is something you would be interested in merging. Thanks!

@addisonwebb
Copy link
Author

I am no longer using Publish and don't have time to update this PR.

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