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

Timepicker time resets when using AM/PM toggle #29720

Closed
tomjn opened this issue Mar 10, 2021 · 3 comments · Fixed by #36878
Closed

Timepicker time resets when using AM/PM toggle #29720

tomjn opened this issue Mar 10, 2021 · 3 comments · Fixed by #36878
Assignees
Labels
[Feature] UI Components Impacts or related to the UI component system [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@tomjn
Copy link
Contributor

tomjn commented Mar 10, 2021

Description

The AM/PM selectors are non-functional, the hour box gets reset to the previous value when switching from AM to PM

Originally reported in a related issue by @Ipstenu, who added a GIF of the problem:

I bet this is related -- if you click on the time and change it, it defaults to AM every time. I'm attaching a GIF of this:

am-pm-who-knows

Related issue #24206

Step-by-step reproduction instructions

Expected behaviour

Setting 11am then pressing PM would change it to 11PM

Actual behaviour

The time is briefly set to 11PM but changes back to 11AM by itself after a brief moment.

Of note, the underlying date/time value does get changed correctly, and can be seen if the value is used in an unrelated component. However, when it is reset in the timepicker component, all other components using this value change too, so it isn't purely local state of the timepicker component that's being reset.

WordPress information

  • WordPress version: 5.6.1, 5.7
  • Gutenberg version: stock WP and GB 10
  • Are all plugins except Gutenberg deactivated? yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? No

Device information

  • Device: MBP 13" Intel, MacOS Big Sur
  • Operating system: MacOS
  • Browser: Chrome 88
@tomjn
Copy link
Contributor Author

tomjn commented Mar 10, 2021

Some notes from a brief look that I left in the other issue:

Do we want to move the AM/PM bug to a new ticket?

I spent 10 minutes to do a quick look these are the next avenues of investigation I would take:

@obulat obulat added [Feature] UI Components Impacts or related to the UI component system [Type] Bug An existing feature does not function as intended labels Mar 31, 2021
@bmehta
Copy link

bmehta commented Nov 17, 2021

We are seeing the exact same behavior as shown in the giphy above. It is also reproducible at https://wordpress.github.io/gutenberg/?path=/story/components-datetimepicker--default after navigating to Knobs at the bottom and checking Is 12 hour (shows AM/PM).

@ciampo
Copy link
Contributor

ciampo commented Nov 25, 2021

Opened #36878 with a potential fix

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants