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

Date/Time picker: ensure hour/minute fields are always shown left to right #16375

Merged
merged 2 commits into from Jul 26, 2019

Conversation

adamsilverstein
Copy link
Member

@adamsilverstein adamsilverstein commented Jul 1, 2019

Fix an issue where right to left languages showed the hour and minute fields reversed, with the minutes on the left instead of the hours.

Fixes #16373.

Description

CSS change: set the direction for the .components-datetime__time-field class.

How has this been tested?

Published a post after setting my profile to use Hebrew.

Verified the hour field shown to the left of the minute field.

Screenshots

After this PR, my post published at 8:44am shows correctly in an RTL language:
image

Types of changes

CSS: set the time field order to ltr regardless of page direction.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adamsilverstein, in my tests, with these changes the design of the am/pm buttons gets broken in RTL languages:
image

I think if we apply the direction style to the class components-datetime__time-field-time instead of components-datetime__time-field the problem gets solved.

@adamsilverstein
Copy link
Member Author

@jorgefilipecosta Thanks for testing, not sure how I missed that :) Fixed in 683bf21, can you please re-test?

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@youknowriad youknowriad merged commit 45c3169 into master Jul 26, 2019
@youknowriad youknowriad deleted the fix/rtl-time branch July 26, 2019 07:55
@youknowriad youknowriad added this to the Gutenberg 6.2 milestone Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date/Time picker hour/minute fields reversed in RTL languages
3 participants