Jump to content

Datetime field won't save in other languages


Klenkes
 Share

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.

Link to comment
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.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...