-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Error in forms with date inputs in german format #27265
Comments
Hi @NeilofSteel. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @NeilofSteel do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@magento give me 2.4-develop instance |
Hi @NeilofSteel. Thank you for your request. I'm working on Magento 2.4-develop instance for you |
Hi @NeilofSteel, here is your Magento instance. |
@magento give me 2.3.4 instance |
Hi @NeilofSteel. Thank you for your request. I'm working on Magento 2.3.4 instance for you |
Hi @NeilofSteel, here is your Magento instance. |
Well only reproduceable in 2.3.4 is there a fix? |
May be worth checking #26675 |
Any update on this issue? Having the same issue with French locale, customers can't create an account. |
After debugging a little, it seems that if we make the following changes:
public function getHtmlExtraParams()
{
$validators = [];
if ($this->isRequired()) {
$validators['required'] = true;
}
$validators['validate-date'] = [
'dateFormat' => $this->getDateFormat()
];
/*
* The patch is here.
* Original code: $validators['validate-dob'] = true;
*/
$validators['validate-dob'] = [
'dateFormat' => $this->getDateFormat()
];
return 'data-validate="' . $this->_escaper->escapeHtml(json_encode($validators)) . '"';
}
define([
'jquery',
'moment',
'jquery/validate',
'mage/translate'
], function ($, moment) {
'use strict';
$.validator.addMethod(
'validate-dob',
function (value, param, params) {
if (value === '') {
return true;
}
return moment.utc(value, params.dateFormat).isBefore(moment.utc());
},
$.mage.__('The Date of Birth should not be greater than today.')
);
}); It's almost good. |
Also reproduced on magento 2.3.5-p1. Same Problem here. No account create possible... |
@Axel29 there is also a validation in vendor/magento/module-ui/view/base/web/js/lib/validation/rules.js where it is used |
To fix my issue I changed the line
in /vendor/magento/module-customer/view/frontend/web/js/validation.js but you should only do that if you use that format too :) |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hello @NeilofSteel Thank you for your report We have rechecked the issue on the latest 2.4-develop and the issue is not reproducible Steps to reproduce:
Actual result: Save customer or create account with no error in the date input We are closing this issue. Please feel free to comment, reopen or create new ticket according to the Issue reporting guidelines |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
I think the reason for that are the "." characters which we are using in dates in germany. -> dd.mm.yyyy
If I set my user Interface-Locale to en_US it works with the format dd/mm/yyyy
The text was updated successfully, but these errors were encountered: