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

DateTime entry point data #240

Closed
zbraniecki opened this issue Sep 11, 2020 · 6 comments · Fixed by #352
Closed

DateTime entry point data #240

zbraniecki opened this issue Sep 11, 2020 · 6 comments · Fixed by #352
Assignees
Labels
A-design Area: Architecture or design C-datetime Component: datetime, calendars, time zones T-core Type: Required functionality T-task Type: Tracking thread for a non-code task
Milestone

Comments

@zbraniecki
Copy link
Member

For the initial release of DateTimeFormat, we'd like to ensure that we understand what data we'd like the future DateTime struct to provide.

For 0.1 release my plan is to include some DummyDateTime or MockDateTime as part of icu-datetime crate which will be a very minimal mock, but with the right information.

This will allow us to present the formatter and enable the Rust community to work on date/time management API that will contain the correct data we need to format it properly.

In particular, @sffc pointed out that we'll likely want the calendar information to be included.

@zbraniecki zbraniecki added A-design Area: Architecture or design C-datetime Component: datetime, calendars, time zones discuss Discuss at a future ICU4X-SC meeting T-core Type: Required functionality T-task Type: Tracking thread for a non-code task labels Sep 11, 2020
@zbraniecki zbraniecki added this to the ICU4X 0.1 milestone Sep 11, 2020
@zbraniecki zbraniecki mentioned this issue Sep 11, 2020
@zbraniecki
Copy link
Member Author

@sffc:

An interesting question is going to be how we represent the rest of the fields: weekday, all three kinds of day period, era, and so forth.

@zbraniecki
Copy link
Member Author

In #301 I'm renaming away from Dummy.

@sffc said he wants to write a short doc about trait and struct considerations for future implementers of a concrete type.

I'd like to ask @nciric @mihnita and @sffc to also review https://github.com/unicode-org/icu4x/blob/master/components/datetime/src/date.rs#L33-L40 and let me know what changes they'd like to see in the type for 0.1.

I will add them with unimplemented!() to communicate the scope of the API we expect others to implement.

@mihnita brought up milliseconds which I'll add, and @sffc mentioned calendars, but I'm not sure how they should be expressed in such mock type.
Anything else?

@sffc sffc removed the discuss Discuss at a future ICU4X-SC meeting label Oct 9, 2020
@mihnita
Copy link
Contributor

mihnita commented Oct 13, 2020

I think that calendar info is needed, probably timezone.

A DateTime class without calendar info is like a currency expressed as in integer (without the currency code)
:-)

I think that the ECMAScript Temporal is a good model.

But it is a bit too complex to try to capture for 0.1 (there is Instant, Date, Time, DateTime, ZonedDateTime, YearMonth, MonthDay, TimeZone, Calendar, etc)
And it is not the job of ICU4X to do that anyway.

For us, if we add info on calendar and timezone (and millisecond), all in the MockDateTime class, I think we are fine.

Data types (Shane?): calendar & timezone will probably need to be classes, with strings for id.
But we can use string for now? ("conflate" the class with the ID, "pretending" that the class is some implementation detail, not exposed in the public APIs)

Making them directly classes would means that we are betting that this is the direction Rust will go, when it gets to solving this problem. And we don't know that.

@zbraniecki
Copy link
Member Author

We ended up working on two documents.

Shane is working on a more detailed explanation for the requirements for the API, while I wrote a shorter "intro" doc for the Rust community to the problem scope and the role of ICU4X in it - https://github.com/unicode-org/icu4x/wiki/Rust-Date-and-Time-API-Request

My doc will be updated to link to Shane's.

@zbraniecki
Copy link
Member Author

Feel free to edit and adjust the wiki as needed @mihnita @sffc and others :)

@zbraniecki
Copy link
Member Author

Shane added https://github.com/unicode-org/icu4x/blob/master/docs/datetime-input.md .

With those two, I consider it done!

@sffc sffc linked a pull request Oct 15, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-design Area: Architecture or design C-datetime Component: datetime, calendars, time zones T-core Type: Required functionality T-task Type: Tracking thread for a non-code task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants