Jump to content
Klenkes

Datetime field won't save in other languages

Recommended Posts

This is a weird one...

- This is a multilanguage website with PW 3.0.123 (but same problem with 3.0.98)
- Default language is german, second language english.
- Fieldtype Datetime

As soon as I change the Date/Time Input Format to a german format (8. April 2019) the field on a page will only save the value if I set the backend language to german. If set it to english(my default) the field won't save the date! Either the field is empty or it defaults to todays date. (Depending on the setting of the field)

It doesn't matter what picker is used.
It doesn't matter if "Default to todays date" is set.
It also happens on PW 3.0.98

It's a matter of backend language and custom input format.

Am I missing something here...

Edit: Why is it that as soon as you write the forum post you find a solution?
If I leave the fieldsettings at default and only change Date Input Format Code to, lets say: d-m-Y it works.
Still... weird.

Share this post


Link to post
Share on other sites

Sometime ago I encountered a similar problem with datetime fields not saving in local language. I think the issue was on Date/Time Output Format Code (field's tab Details).

While for default language it was ok to use PHP date format, for locale languages I had to change to PHP strftime format. Example:

- default (English): F j, Y H:i T

- locale (Italian): %e %B %G %H:%M

I got the hint combining this old post with the note above Date/Time Output Format Code: "The date/time will be output according to the format below. This is automatically built from the date/time selections above, but you may change it as needed to suit your needs. See the PHP date function reference for more information on how to customize this format. Alternatively, you may use a PHP strftime format if desired for localization."

Yes... a bit weird! 🤔 I hope you can find it useful.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...