-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use newly-exported libshared DateTimeEdit controls #118
base: master
Are you sure you want to change the base?
Conversation
Now this is very, very nice! 👍 |
Could you share your decision of including a copy of the control rather than including it from the system and linking to libshared.a? |
I don't see a copy of the Haiku code here? I see an identically named class that subclasses it and customizes the drawing a bit to add borders around it. |
You're right, I overlooked that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use B_MEDIUM_DATE_FORMAT instead of B_SHORT_DATE_FORMAT?
For the German locale that would mean instead of "24.12.22" the more common "24.12.2022".
I tried to replace it everywhere, but the start/end dates are still formatted 'short'. Is there not enough space in the "new event" dialog?
Hmm, that'd probably have to be done as a patch to DateTime in libshared, since the function determining it (DateTime::_UpdateFields) is private. It could be exposed as an option pretty easily. I'm not sure how well that'd work across the board, though, since several locales use month-names in MEDIUM_FORMAT― I don't think the class necessarily requires sections to be numbers, though. If text doesn't render well, maybe using the the most complicated number-only format would work? |
It should be possible to extend the locale API to allow more control on the date format by using "skeletons" as documented here: The idea is that you give a string with date fields such as "yMMd" and ICU can compute the proper format (in the right order and with appropriate separators). Then we can force to keep a numeric format while having a 4 digit year. Which is indeed not guaranteed with the "medium" format. |
@JadedCtrl any progress on this one? |
@scottmc Unfortunately not, I haven't touched Haiku or Calendar code in a bit. |
Just swaps out the text controls with the exported DateEdit and TimeEdit.