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

AM/PM button on calendar does not activate in Japanese environment #22924

Closed
inc2734 opened this issue Jun 5, 2020 · 0 comments · Fixed by #22963
Closed

AM/PM button on calendar does not activate in Japanese environment #22924

inc2734 opened this issue Jun 5, 2020 · 0 comments · Fixed by #22963
Labels
[Feature] UI Components Impacts or related to the UI component system Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended

Comments

@inc2734
Copy link
Contributor

inc2734 commented Jun 5, 2020

Describe the bug
AM/PM button on calendar does not activate in Japanese environment.
datetime is updated successfully.

It is correctly reversed in English environment.

To reproduce
Kapture 2020-06-05 at 15 26 30

Expected behavior
I want the appropriate AM/PM button to be active.

Editor version (please complete the following information):
I tried it in the following environment.

  • WordPress 5.4.1
  • WordPress 5.4.1 + Gutenberg 8.2.1

Additional context

I think there is a problem with the following part.

const am = selected.format( 'A' );

On Japanese environment, moment().format('A'); return 午後 or 午前.

But below is a comparison with "AM" or "PM".

<Button
aria-pressed={ am === 'AM' }
isDefault
className="components-datetime__time-am-button"
isToggled={ am === 'AM' }
onClick={ this.updateAmPm( 'AM' ) }
>
{ __( 'AM' ) }
</Button>
<Button
aria-pressed={ am === 'PM' }
isDefault
className="components-datetime__time-pm-button"
isToggled={ am === 'PM' }
onClick={ this.updateAmPm( 'PM' ) }
>
{ __( 'PM' ) }
</Button>

@miminari miminari mentioned this issue Jun 6, 2020
2 tasks
@ocean90 ocean90 added [Feature] UI Components Impacts or related to the UI component system [Type] Bug An existing feature does not function as intended labels Jun 6, 2020
@torounit torounit added the Internationalization (i18n) Issues or PRs related to internationalization efforts label Jun 16, 2020
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 Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants