Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Make datetime.rs structs and fields public #431 #439

Merged
merged 5 commits into from Aug 20, 2021

Conversation

xpe
Copy link
Contributor

@xpe xpe commented Aug 15, 2021

In issue #431, @samuelcolvin wrote:

I'd like to be able to access the fields of Datetime (and then obviously Date and Time) directly rather than having to re-parse the result of to_string().

I don't need chrono integration, just direct access to the integer values.

Would you accept a PR for this?

Then @alexcrichton replied:

Seems reasonable to me to add!

@samuelcolvin
Copy link

LGTM

@alexcrichton
Copy link
Collaborator

Can you fill out the documentation for each field and what it corresponds to for datetimes as specified by toml?

@xpe
Copy link
Contributor Author

xpe commented Aug 18, 2021

Can you fill out the documentation for each field and what it corresponds to for datetimes as specified by toml?

I think I can gather the information to do that. I'll take a look.

@xpe
Copy link
Contributor Author

xpe commented Aug 20, 2021

@alexcrichton I added some docs, hope you like 'em!

@alexcrichton
Copy link
Collaborator

Thanks!

@alexcrichton alexcrichton merged commit 83d787c into toml-rs:master Aug 20, 2021
samuelcolvin added a commit to samuelcolvin/rtoml that referenced this pull request Sep 5, 2021
@samuelcolvin
Copy link

I've tested this in rtoml samuelcolvin/rtoml#30.

It's working great. Thank you both.


/// Offset between local time and UTC
Custom {
/// Hours: -12 to +12
Copy link
Contributor

Choose a reason for hiding this comment

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

It's very minor, but I happened to notice that these docs are slightly incorrect: this can be as large as +13 or even +14 https://en.wikipedia.org/wiki/UTC%2B14:00 for real timezones, on some Pacific islands.

imageimage

A special mention for Chatham Islands during DST, where the offset is +13:45.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Filed #444

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@huonw Nice find! This made my day on GitHub for sure!

@ehuss ehuss mentioned this pull request Sep 9, 2021
samuelcolvin added a commit to samuelcolvin/rtoml that referenced this pull request May 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants