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

Informal icu_calendar rereview #5632

Closed
Manishearth opened this issue Oct 1, 2024 · 8 comments · Fixed by #5701
Closed

Informal icu_calendar rereview #5632

Manishearth opened this issue Oct 1, 2024 · 8 comments · Fixed by #5701
Assignees

Comments

@Manishearth
Copy link
Member

We changed a bunch of icu_calendar for 2.0, and still have some changes planned (#4889)

Now is a good time to have another look at the API shape and do any necessary cleanups.

@Manishearth Manishearth added this to the ICU4X 2.0 Beta ⟨P1⟩ milestone Oct 1, 2024
@Manishearth Manishearth self-assigned this Oct 1, 2024
@Manishearth
Copy link
Member Author

Manishearth commented Oct 15, 2024

Thoughts:

  • Should the individual calendar modules all be organized under icu_calendar::calendars::*? They feel cluttered right now. We could reexport individual calendars into this module.
  • WeekCalculator could do with more docs
  • We're probably getting rid of DateTime, IsoHour, IsoMinute, IsoSecond, NanoSecond
  • We should change MonthInfo to use a FormattableEra code that can be numeric rather than an era code.
  • All the try_new_foo_date functions should have uniform APIs and say with_calendar if they're with a calendar

@Manishearth
Copy link
Member Author

@sffc thoughts on the first bullet point?

@sffc
Copy link
Member

sffc commented Oct 15, 2024

Hmm, the word "calendar" is already in the crate name, but I agree it would be nice to put the calendars in their own namespace separate from Date and other types/traits.

Maybe icu_calendar::cal::Buddhist? (better than icu_calendar::buddhist::Buddhist)

@sffc
Copy link
Member

sffc commented Oct 15, 2024

We're probably getting rid of DateTime, IsoHour, IsoMinute, IsoSecond, NanoSecond

We can get rid of DateTime, but we need Time, IsoHour, ... somewhere because icu_datetime uses them

@Manishearth
Copy link
Member Author

icu_calendar::cal::{Buddhist, etc} works for me.

I will also have the individual calendar modules live there, because the BuddhistDateInner (etc) types need to live somewhere

@sffc
Copy link
Member

sffc commented Oct 15, 2024

Thought: icu_calendar::cal::Buddhist and icu_calendar::cal::scaffolding::BuddhistDateInner (as exports only; actual types live in a file named buddhist.rs)

@Manishearth
Copy link
Member Author

scaffolding wfm.

I think any_calendar should live at the top level though, as it does now.

@sffc
Copy link
Member

sffc commented Oct 16, 2024

I named it scaffold in #5690 since the style guide is to omit suffixes

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 a pull request may close this issue.

2 participants