-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fmt/temporal: add new
Pieces
type for granular ISO 8601 parsing
This commit adds a new type to the `jiff::fmt::temporal` module that exposes the raw components of a parsed Temporal ISO 8601 datetime string. This is meant to address use cases that need something a bit more flexible than what is provided by the higher level parsing routines. Namely, the higher level routines go out of their way to stop you from shooting yourself in the foot. For example, parsing into a `Zoned` requires a time zone annotation. But parsing into a `Pieces` doesn't require any of that. It just has to match the Temporal ISO 8601 grammar. Then you can mix and match the pieces in whatever way you desire. And indeed, you can pretty easily shoot yourself in the foot with this API. I feel okay about this because it's tucked into a corner of Jiff that you specifically have to seek out to use. I've also included examples in the docs of _how_ you can easily shoot yourself in the foot. I've included a couple case studies in the docs reflecting some real world examples I've come across in the issue tracker. Ref #112, Ref #181, Closes #188, Ref tc39/proposal-temporal#2930
- Loading branch information
1 parent
4ea5eff
commit 9717535
Showing
11 changed files
with
2,227 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.