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

TimeField value can become out of sync with time entry fields (11.12.5) #198

Open
Matt-Errington opened this issue Feb 27, 2023 · 0 comments

Comments

@Matt-Errington
Copy link

If you type a number greater than 23 into hours or 59 into minutes the corresponding LocalTime element will be set to its maximum value but the value in the field will remain as entered. For example, if you enter 123 into the hour field the hour element of the LocalTime value will be set to 23 but the hour field will still show 123.

Additionally, if you enter a value greater than Integer.MAX_INT both the hour and minute LocalTime values are set to 0 (but the large value remains in the field).

Code Example:

final TimeField timeField = new TimeField();
timeField.valueProperty().addListener((observable, oldValue, newValue) -> {
	System.out.println("TimeField value changed");
	System.out.println("Hour: " + newValue.getHour());
	System.out.println("Minute: " + newValue.getMinute());
});

Output:

// Initial TimeField value 12:30
// Change hour to 123
TimeField value changed
Hour: 23
Minute: 30

// Hold 9 key until hour value is 123999999999999999
TimeField value changed
Hour: 0
Minute: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant