icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Date::try_new_hebrew, try_new_chinese, and try_new_dangi should take month codes

Open sffc opened this issue 3 months ago • 3 comments

Ordinal months should not be used in these calendars because they are misleading. The constructors for these specific calendars should instead take month codes. Ideally as just strings because then they are easier to write:

Date::try_new_hebrew(5783, "M06", 20).unwrap()

Probably keep the current strict/rejecting behavior. If people want lenient behavior, we have APIs for them.

Maybe add a new API for now, deprecate the old one, and migrate in 3.0.

sffc avatar Oct 07 '25 01:10 sffc

+1 I've thought this before as well

robertbastian avatar Oct 08 '25 10:10 robertbastian

I agree.

Manishearth avatar Oct 13 '25 22:10 Manishearth

See discussions about the name in https://github.com/unicode-org/icu4x/issues/7111#issuecomment-3437958195 and #7095

sffc avatar Nov 06 '25 16:11 sffc

Triage: Remains in 2.2 unless we decide that date-from-fields is no longer a headline item.

Manishearth avatar Dec 19 '25 22:12 Manishearth