Skip to content

Cannot save date on product attribute when using a locale that changes date format and the day is greater than 12 #12700

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

Closed
bmisyura opened this issue Dec 14, 2017 · 2 comments
Labels
bug report Component: Catalog Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release

Comments

@bmisyura
Copy link

bmisyura commented Dec 14, 2017

If you add a date attribute to a product or add a date in a product widget and are using a locale that changes the date format and the day set is greater than 12, you get the following error when saving:
Invalid input datetime format of value '14/06/2017'. If you set the date in US english first and then switch to another locale, it displays an incorrect date (when day is greater than 12). If you set a date in US english with day less than 12 and then switch the locale, it shows the original US date format.

Preconditions

  1. Install Magento from 2.2-develop branch

Steps to reproduce

  1. Go to system>permissions>all users and set the admin user locale to English Australia and save
  2. Go to stores>atttributes>products and create a date attribute
  3. Go to stores>atttributes>attribute set
  4. Add the attribute to default set
  5. Create a new product
  6. Set the date to any month with the day being greater than 12
  7. Try to save
  8. Notice the error - Invalid input datetime format of value '14/06/2017

  1. Go to system>permissions>all users and set the admin user locale to English US and save
  2. Go to stores>atttributes>products and create a date attribute
  3. Go to stores>atttributes>attribute set
  4. Add the attribute to default set
  5. Create a new product
  6. Set the date to any month with the day being greater than 12 (Feb 14 2018)
  7. Save the product
  8. Go to system>permissions>all users and set the admin user locale to English Australia and save
  9. go back to the product
  10. Notice the date is incorrect (06/12/2017)
  11. Notice you cannot save the product and error is given "Invalid input datetime format of value '14/02/2018'"

  1. Go to system>permissions>all users and set the admin user locale to English US and save
  2. Go to stores>atttributes>products and create a date attribute
  3. Go to stores>atttributes>attribute set
  4. Add the attribute to default set
  5. Create a new product
  6. Set the date to any month with the day being less than 12
  7. Save the product
  8. Go to system>permissions>all users and set the admin user locale to English Australia and save
  9. go back to the product
  10. Notice the date is still in US format

The merchant states that this also occurs if you add a date to a product widget

Expected result

The product should save and the dates should be correct when switching the locale after a date is set in US locale

Actual result

The product does not save and gives the error Invalid input datetime format of value '14/06/2017. The date is not correct when switching the locale after a date is set in US locale.

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Dec 14, 2017
@gwharton
Copy link
Contributor

Heavily related, and possible duplicate of #10580

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Dec 14, 2017
@alena-marchenko alena-marchenko added Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Dec 14, 2017
@Mobecls Mobecls self-assigned this Dec 15, 2017
@ishakhsuvarov
Copy link
Contributor

Closing per comment above.
Thanks for pointing out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release
Projects
None yet
Development

No branches or pull requests

7 participants