-
Notifications
You must be signed in to change notification settings - Fork 184
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
Hour Cycle Preferences ignored #671
Comments
This seems to be a carry over from 0.1 where it also didn't work. |
Ahh, I didn't realize Greg took it and started exploring it and thought "maybe it's trivial and can get it into 0.2?" - oh how foolish of me. Greg, I'd be happy to collab with you on that, as this seems to me non-trivial. I started looking into this and I'm no longer sure how we should approach it since My initial take, that I started exploring in https://github.com/zbraniecki/icu4x/tree/length_preferences is that we would take a pattern and just apply the hour_cycle preferences as a two step algo:
But that unfortunately leads to two issues:
I looked into what SpiderMonkey is doing - https://searchfox.org/mozilla-central/source/js/src/builtin/intl/DateTimeFormat.cpp#749 - and it seems that anba ( I'm sorry Anba, I added the preferences to ECMA-402 style bag!) does:
That seems costly, but reasonable. If we wanted to support it, we'd need to add I'm also wondering if we can leverage input skeleton symbols like
This would mean that for cases where length::Bag is used without preferences, we're adding extraneous logic, but for components and for length bags where preferences are used it should result in comparable amount of instructions with more reliable architecture. Greg - thoughts? |
I haven't looked into this issue yet, so I don't have thoughts on your feedback so far. I'm only lightly attached to this issue so feel free to take over, or when I started working on it I'll provide feedback to the above. |
Thanks for the brain dump Zibi. I looked at what you suggested. I think the approach here will be to invoke the skeleton matching machinery, but do it in a CLDR transform. It will double the memory size of the time styles, but it means we can have a fast path of not having to invoke that code at runtime. The two variants would be either the I have code now that does this at runtime, but I'd like to port the skeleton matching code to happen in the transfrom. |
I can't seem to make the preferences work in the length bag:
I'd expect it to make
cargo run --example work_log
display 23 hour time, but it stays 11h.The text was updated successfully, but these errors were encountered: