-
Notifications
You must be signed in to change notification settings - Fork 26
Default 24 hour notation for search criteria #130
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Richard Ogin <rogin@users.noreply.github.com>
Can this respect the OS preference instead? It looks like Java provides access to the user's preferred 12/24 time format via import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
public class Main {
public static void main(String[] args) {
System.setProperty("java.locale.providers", "HOST");
System.out.println(LocalTime.now().format(DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT)));
}
} Prints |
I like the idea. Your link omits linux compatibility in Oracle's v11, so perhaps linux guys can check their systems. If good, I could add a new slot in Settings>Administrator>User Preferences, with an option like "Use 24 hour notation for search criteria" with Yes, No, Use system default. I'd model the logic of reading and storing the boolean like used for "Import code template libraries with channels". |
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.
I like having it configurable as a user preference. I'm not sure how useful it would be to pull from system preferences, because all of my desktop clocks are set to 12-hour format for display, but I would certainly rather use 24-hour format for search parameters instead of needing to add AM/PM. Search results already display in 24-hour format, and that is not configurable.
I know with user preferences they can either be saved in the database (which would follow the user to multiple devices when logging into the same server) or to the local machine, which won't follow the user if they log in on multiple devices, but should work across multiple server instances when logging in from the same device.
I think my preference would be to make it a local user preference that would default to 24-hour when not set. I think that follows the spirit of the original PR.
I'm not sure what the other implications are for forcing the locale provider to HOST
. According to https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/spi/LocaleServiceProvider.html, that property is supposed to set the user's preferred lookup order. HOST
is not always available in all runtime environments, nor is it even present in the default order of CLDR,COMPAT
.
I think the way @rogin has done it is on point. Use the system preference by default, allow it to be overridden. We're specifically talking about a UI aspect - not a server or backend thing where there's a single right answer. Respecting the user's system preferences is a UX best practice. People can be peeved when you do not (especially the "dark mode is the one true mode" crowd). Font size, contrast, motion preferences, dates/number/money formatting, theme/dark/light mode are all available from the system on Windows/Mac/Android/Web. |
I'll try to bullet-point my previous comment. I'm not disagreeing with you about respecting user preferences.
When it comes to the release notes I think this would capture the two choices we are discussing:
I think the first option is cleaner and will require fewer people to actually need to go in and change the setting. |
@tonygermano, This is not my issue - so I'm not pushing here. I stand by the comment re: best practice, but will not oppose regardless of outcome of this PR. |
I agree with Tony's first option. I'll update the code. |
Adds a checkbox to the Messages Browser and Events Browser which toggles the time format of the time input fields between
HH:mm
andhh:mm aa
. On form load and on search reset, it defaults to 24hr notation.I used most of the previous PR, but I changed the listener to one that responds to
JCheckbox.setSelected(bool)
. Changes to the.form
files were also included, but those may be completely unused.Related
Previous PR - nextgenhealthcare/connect#5989
Summary table in #121