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

DateTime's behavior in Linux is undesirable #180

Open
ManOnSaturn opened this issue May 31, 2022 · 0 comments · May be fixed by #484
Open

DateTime's behavior in Linux is undesirable #180

ManOnSaturn opened this issue May 31, 2022 · 0 comments · May be fixed by #484
Labels
Linux/GTK Happens on Linux

Comments

@ManOnSaturn
Copy link

Describe the bug
On Ubuntu, it's possible to input more than 2 digits when trying to input a time. The behavior is different than the one in Windows, where the time gets automatically edited to the next meaningfull integer based on last input.

To Reproduce

  1. Create a time picker by writing
    DateTime time = new DateTime(timeComposite, SWT.TIME | SWT.SHORT | SWT.BORDER | SWT.CENTER);
  2. Interact with it by typing numbers that would result in non-valid hours or minutes, which are shown nevertheless.

Expected behavior
Scenario: 3:00 AM is set.
Try and edit the hours by typing 31. The hours should change to a 1, since 31 would not be valid.
If 1 is pressed again, the hours should change to 11.
If 1 is pressed again, the hours should change to 1, again.

Screenshots
image

Environment:

  • Select the platforms on which the behavior is seen.
    [] All OS
    [ ] Windows
    [x] Linux
    [ ] macOS (can't verify)

  • Additional OS info (e.g. OS version, Linux Desktop, etc)
    Ubuntu 20.04 running in a VM.

  • JRE/JDK version
    Temurin jdk-17.0.2+8.

Version since
Always been a problem AFAIK.

Workaround (or) Additional context
There are no possible workarounds, since the text that's displayed while in editor mode is inside an incapsulated variable of DateTime.java.

A possible solution may be to make the method "onNumberKeyInput" aware of what's been edited and hence set constraints.

@lshanmug lshanmug added the Linux/GTK Happens on Linux label May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux/GTK Happens on Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants