Skip to content

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

Open
sternhagel wants to merge 1 commit into
soderlind:mainfrom
sternhagel:master
Open

fixed non-working format conversion for non-English month names#109
sternhagel wants to merge 1 commit into
soderlind:mainfrom
sternhagel:master

Conversation

@sternhagel
Copy link
Copy Markdown

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
Copy Markdown
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