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

fixed non-working format conversion for non-English month names #109

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

Conversation

sternhagel
Copy link

This is my attempt to fix the following issue: Date/Time cleared when saving post

With these changes it works for me to enter dates formatted using German language month names, e.g. "03. März 2017 14:30"

I didn't test any other languages, but in theory it should work for every language.
Please note that to work properly, I had to set the PHP locale globally to "de_DE.UTF8" in the wp-config.php:
setlocale( LC_ALL, 'de_DE.UTF8' );

I didn't find a way to do this dynamically in the plugin code, and I'm not sure whether it's a general issue or depending on local PHP configuration. Without setting the UTF8 locale explicitly, the date conversion didn't work for me when the string contained non-ASCII characters (like the "ä" in "März").

@soderlind
Copy link
Owner

Thank you. I'll test it locally before I do the merge.

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.

2 participants