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

[MaterialTimePicker] set time wrongly in TimeFormat.CLOCK_12H #4495

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

Conversation

ls9487
Copy link

@ls9487 ls9487 commented Dec 20, 2024

val picker = MaterialTimePicker.Builder()
.setTimeFormat(TimeFormat.CLOCK_12H)
.setHour(7)
.setMinute(0)
.setTitleText("Select Time")
.build()
picker.show(supportFragmentManager, null)

picker.hour = 20
(this will set time to 8 am not 8 pm)

Thanks for starting a pull request on Material Components!

Don't forget:

  • Identify the component the PR relates to in brackets in the title.
    [Buttons] Updated documentation
  • Link to GitHub issues it solves. closes #1234
  • Sign the CLA bot. You can do this once the pull request is opened.

Contributing
has more information and tips for a great pull request.

val picker = MaterialTimePicker.Builder()
.setTimeFormat(TimeFormat.CLOCK_12H)
.setHour(7)
.setMinute(0)
.setTitleText("Select Time")
.build()
picker.show(supportFragmentManager, null)

picker.hour = 20
(this will set time to 8 am not 8 pm)
Copy link

google-cla bot commented Dec 20, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ls9487 ls9487 changed the title Fix bug MaterialTimePicker.java [MaterialTimePicker] in TimeFormat.CLOCK_12H set time wrongly Dec 20, 2024
@ls9487 ls9487 changed the title [MaterialTimePicker] in TimeFormat.CLOCK_12H set time wrongly [MaterialTimePicker] set time wrongly in TimeFormat.CLOCK_12H Dec 20, 2024
@paulfthomas paulfthomas self-assigned this Dec 20, 2024
@paulfthomas
Copy link
Member

Thanks for the PR, this looks like an edge case (as you're using setTimeFormat(TimeFormat.CLOCK_12H)) but I think the fix is a good idea, can you accept the Contributor License Agreement (CLA) above?

@ls9487
Copy link
Author

ls9487 commented Dec 21, 2024

I have accepted

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

Successfully merging this pull request may close these issues.

2 participants