Replace the icu4c-based calendar implementation with one built on the icu4x Rust crate (icu_calendar). The icu4c API does not expose the píngqì month-assignment algorithm used by the Chinese and Dangi lunisolar calendars. Our old code had to approximate this by walking months via epoch millisecond arithmetic and manually tracking leap month positions, which produced incorrect month codes and ordinal month numbers for certain years. The icu4x calendar crate handles píngqì natively. With this patch, which is almost a 1-to-1 mapping of ICU invocations, we pass 100% of all Temporal test262 tests. The end goal might be to use icu4x for all of our ICU needs. But it does not yet provide the APIs needed for all ECMA-402 prototypes.
13 lines
340 B
TOML
13 lines
340 B
TOML
[package]
|
|
name = "libunicode_rust"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
[lib]
|
|
crate-type = ["staticlib"]
|
|
|
|
# After changing dependencies, regenerate the Flatpak sources:
|
|
# python3 Meta/CMake/flatpak/generate-cargo-sources.py
|
|
[dependencies]
|
|
calendrical_calculations = "0.2"
|
|
icu_calendar = { version = "2.1.1", features = ["compiled_data"] }
|