Skip to content

Date constructor for Dangi should not have "chinese" in the name #7095

@sffc

Description

@sffc

In 2.0, you can write:

let cal = Dangi::new();
Date::try_new_dangi_with_calendar(1, MonthCode::new_normal(1).unwrap(), 1, cal)

On main, you need to instead write:

let cal = LunarChinese::new_korea();
Date::try_new_chinese_with_calendar(1, MonthCode::new_normal(1).unwrap(), 1, cal)

I really struggle to see how this is an improvement. It's one fewer method, but the cost is that we have the word "chinese" twice and "korea" once even though we are constructing a Korean calendar. (Yes, this discussion is colored a bit by "calendar is a thing used by a group of people" versus "calendar is an algorithm")

How about we fix this issue and also change the constructor to take a string for the month code.

let cal = AsianLunar::new_korea();
Date::try_new_asian_lunar_with_calendar(1, "M01", 1, cal)

@robertbastian @Manishearth

Metadata

Metadata

Assignees

Labels

C-calendarComponent: Calendarsdiscuss-priorityDiscuss at the next ICU4X meeting

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions