Magento2: Cannot create Customer with Date of Birth in Magento 2.1 (en_GB locale)

Created on 24 Aug 2016  Â·  11Comments  Â·  Source: magento/magento2

Environment

  1. Apache 2.4.17
  2. MySQL 5.0.11-dev
  3. PHP 5.6.15
  4. Magento 2.1.0

    Steps to reproduce

  5. In System > All Users > User > [You], set the interface locale to English (United Kingdom):
    blog-3

  6. Create a new customer. Make sure to fill in Date of Birth field:
    c-1
  7. Save Customer

    Expected result

  8. Customer saves without error

    Actual result

  9. "Invalid date" exception thrown:
    c-2

  10. Trying to save the new customer again results in a JS validation error:
    c-3

    Cause

  • The culprit is Date::inputFilter()
  • In my case, Date::inputFilter() accepts 08/24/2016 and returns 0,8/2,4/2,016
  • 0,8/2,4/2,016 is not a real date in any locale, causing an exception to be thrown.

    General locale issues in Magento 2.1

  • Changing admin locale from en_US to en_GB causes PHP date formats to change, but not JS date formats.

  • In the above example, the JS datepicker populated the field with 08/24/2016, despite the entire UI being in en_GB.
Customer Fixed in 2.2.x Format is not valid Ready for Work 2.1 Reproduced on 2.1.x bug report

All 11 comments

Internal ticket created MAGETWO-57835, thanks for reportng

The issue has been fixed and delivered to develop.

@slavvka, thanks! :)

In frontend the date works well, the issue is just in backend and with all dates. The reports don't work too.

@sopedro, Magento2 admin locale is a mess. See, for example, #7888, #9426, #8849.

These, and similar issues, are widely-reported but development seems to slow.

Steps to reproduce:

  1. Install Magento latest develop version.
  2. Go to Admin side
  3. System > All Users
  4. Choose your user, then set Interface local to United Kingdom
  5. Click "Save"
  6. Click "Customers > All customers"
  7. Click "Add new"
  8. Fill all required fields
  9. Choose birthday date "Today"
  10. In email field enter already existed email address
  11. Click "Save"
  12. After error change email on non existing and click "Save"

AR: Displayed error about incorrect date
ER: Customer should be saved

Note: but after first saving date changed on other date automatically.

I am working on it..

Issue fixes 1 month ago.
Thank you

Le 10 juin 2017 14:03, "nitin700" notifications@github.com a écrit :

I am working on it..

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/magento/magento2/issues/6323#issuecomment-307555545,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AZPmOtHVSzLKV3Roklk-2wea3dLSBTCsks5sCmoDgaJpZM4JsFYc
.

@Emadis Thanks for the information.

@JacobDrummond, thank you for your report.
The issue is already fixed in 2.2.0

Still a issue for 2.2.3

Trying to set "Set Product as New From"

Message "Invalid input datetime format of value '31/05/2018"

Was this page helpful?
0 / 5 - 0 ratings