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

Fix/date picker localization #546

Merged
merged 4 commits into from
Dec 19, 2019
Merged

Fix/date picker localization #546

merged 4 commits into from
Dec 19, 2019

Conversation

cojennin
Copy link
Contributor

@cojennin cojennin commented Nov 4, 2019

Description

Fixes #457. Instead of trying to parse the localized date (which fails when using strtotime or DateTime::createFromFormat for certain cases), we're setting the DateTime numerically so we can parse it.

Also, we're adding a z-index to the DatePicker, it was hidden when using the BlockEditor

Steps to Test

  1. In Settings, set language to Dansk
  2. Select a post, and modify a date editorial metadata and select a date in May
  3. Save the post, and confirm that the date is saved

Previously, a date in the month of May would not save (because strotime and DateTime:createFromFormat would fail to parse it) when the language was Dansk. This was probably impacting other languages as well

@mjangda mjangda added this to the 0.9.2 milestone Nov 5, 2019
@cojennin cojennin force-pushed the fix/date-picker branch 5 times, most recently from 722a601 to d7f0959 Compare November 27, 2019 16:35
@cojennin
Copy link
Contributor Author

Part of this PR also encompasses fixing up the PHPUnit testing to enforce better ordering (AJAX unit tests define DOING_AJAX and need to happen last to prevent interference with other test), see wordpress-develop for reference

phpunit.xml.dist Outdated Show resolved Hide resolved
mjangda
mjangda previously approved these changes Dec 18, 2019
Copy link
Member

@mjangda mjangda left a comment

Choose a reason for hiding this comment

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

One minor change and we're good to go.

tests/test-edit-flow-custom-status-ajax.php Show resolved Hide resolved
To match runInSeparateProcess
@cojennin
Copy link
Contributor Author

cojennin commented Dec 18, 2019

@mjangda made one small change to resolve test failures on PHP 5.6.

Copy link
Member

@mjangda mjangda left a comment

Choose a reason for hiding this comment

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

Ah, thanks for fixing that test. I kept meaning to push up a fix but wasn't annoying enough until now since it only impacted PHP 5.6.

@cojennin cojennin merged commit b4c283d into master Dec 19, 2019
@cojennin cojennin deleted the fix/date-picker branch January 29, 2020 21:34
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.

Cannot save Date meta field with international name
2 participants