Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JadedCtrl
Copy link
Contributor

Just swaps out the text controls with the exported DateEdit and TimeEdit.
datetime

@humdingerb
Copy link
Member

Now this is very, very nice! 👍
I'll let this PR sit for a few days to see if other have some input. Looks very good to me!

@nielx
Copy link

nielx commented May 30, 2022

Could you share your decision of including a copy of the control rather than including it from the system and linking to libshared.a?

@pulkomandy
Copy link
Member

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.

@nielx
Copy link

nielx commented May 30, 2022

You're right, I overlooked that.

Copy link
Member

@humdingerb humdingerb left a 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?

@JadedCtrl
Copy link
Contributor Author

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?

@pulkomandy
Copy link
Member

It should be possible to extend the locale API to allow more control on the date format by using "skeletons" as documented here:
https://cldr.unicode.org/translation/date-time/date-time-patterns

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.

@scottmc
Copy link
Member

scottmc commented Oct 10, 2022

@JadedCtrl any progress on this one?

@JadedCtrl
Copy link
Contributor Author

@scottmc Unfortunately not, I haven't touched Haiku or Calendar code in a bit.

@scottmc scottmc added the hacktoberfest Issues proposed to Hacktoberfest participants label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues proposed to Hacktoberfest participants
Development

Successfully merging this pull request may close these issues.

5 participants