Skip to content

Cannot set minute or hour to 0 for TimePicker on Android #1813

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

Closed
lonerzzz opened this issue May 10, 2019 · 7 comments
Closed

Cannot set minute or hour to 0 for TimePicker on Android #1813

lonerzzz opened this issue May 10, 2019 · 7 comments
Assignees

Comments

@lonerzzz
Copy link

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: Description of value source needed in bug template
  • Cross-platform modules: Description of value source needed in bug template
  • Android Runtime: 5.3.1
  • iOS Runtime:
  • Plugin(s): Description of value source needed in bug template
  • NativeScript-Angular: 6.2.0
  • Angular: 6.1.10

Describe the bug
I am referencing the following issue because it perfectly describes the problem, but was closed on the assumption that the bug was fixed without being validated:

nativescript-vue/nativescript-vue#148

To Reproduce
See the above issue.

Expected behavior
Setting all values in the range 0 to 59 should be possible for the minute value, but setting to zero is being treated as a case to ignore the value

Sample project
None

Additional context

@tsonevn tsonevn self-assigned this May 10, 2019
@tsonevn
Copy link
Contributor

tsonevn commented May 10, 2019

Hi @lonerzzz,
I checked the described case, however, was unable to recreate the issue. I tested setting the minutes for the TimePicker via UI and code-behind and in both cases, the minutes were set correctly to zero. Check out the sample project here.

@lonerzzz
Copy link
Author

lonerzzz commented May 10, 2019

Your implementation provides one way to get it working, but someting about the implementation is currently brittle to the initialization. I have updated your code with a version 2. For me, the minutes are neither correct on startup nor when the button is pressed:

https://play.nativescript.org/?template=play-ng&id=3e8b92&v=2

@lonerzzz
Copy link
Author

lonerzzz commented May 10, 2019

I have subsequently determined that the time cannot be 12:00 AM. A zero is not allowed in the hour position either in certain cases:

https://play.nativescript.org/?template=play-ng&id=3e8b92&v=3

@lonerzzz lonerzzz changed the title Cannot set minute to 0 for TimePicker on Android Cannot set minute or hour to 0 for TimePicker on Android Jul 19, 2019
@MrSnoozles
Copy link

MrSnoozles commented Nov 23, 2020

This seems to be a Nativescript core issue, as I just noticed it happens with Vue too.

If you run the example you'll see neither the minute nor the hour are set to 0. Every value other than 0 works. https://play.nativescript.org/?template=play-vue&id=Xz1XRK

Workaround: If you set it to new Number('0') it will work

@MrSnoozles
Copy link

@tsonevn Can you check if the Vue playground above works for you (the minute/hour should be showing 0 instead of the current minute/hour)?

If it is working for you it might be a device-specific problem. If it is not working it's a core issue and has nothing to do with nativescript-angular either, as this happens with all flavours.
For NS core there is already on open issue here: NativeScript/NativeScript#8941

@luisVargasGu
Copy link

This is still not working, the playground project provided here does not set the values to 0. In my case it is Nativescript Angular.

@NathanWalker
Copy link
Contributor

Closed via NativeScript/NativeScript#10460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants