I don't yet have a full solution (other than modifying the html for the date of birth line to remove the type="date" portion), but I can confirm that this is an issue with at least one other mobile device.
The date is filled in to "look" like what is desired (MM/DD/YYYY); however, upon submission, the date provided is: YYYY-MM-DD which is then parsed using zen_raw_date which totally mucks up the result:
Ie put in: 07/08/1999, the posted $dob is 1999-07-08 and then the zen_raw_date result is: 7-08199- which is not exactly a valid date. Of course it also fails the '/' part, but there doesn't appear to be anything that requires the / just a divider between sets of numbers and the fact that the numbers are in two(one divider)two(one divider)four...
Looks like issue might be in: includes/templates/responsive_classic/jscript/jscript_responsive_framework.php at or around line 69:
Code:
$('input#dob').clone().attr('type','date').insertAfter('input#dob').prev().remove();
such that if that were removed, then the "phones" date chooser wouldn't appear... but at least the user could enter the birth date in the format requested...
It's a patch, not a fix.
I feel like this also might have been previously identified, though I'm not sure. Commenting out that line seems to support the date entry.
So otherwise, would need to do some other form of validation such as part of zen_date_raw to identify the existence of non-numeric values, if the values are non-numeric then perhaps use the original data formed by numbers only (as that would have been in the raw date form expected...) or in looking at the code, since the $_POST['dob'] is used, to modify $_POST['dob'] to again be the date format desired? Though I don't know how "localities" play into the javascript/jquery fed date. The test I did provided YYYY-MM-DD, but in another location could it instead provide it in another format?
Proposal is either of two things:
comment out line 69 of includes/templates/responsive_classic/jscript/jscript_responsive_framework.php:
Code:
// $('input#dob').clone().attr('type','date').insertAfter('input#dob').prev().remove();
or
in includes/modules/create_account.php
change:
Code:
if (ACCOUNT_DOB == 'true') {
if (ENTRY_DOB_MIN_LENGTH > 0 or !empty($_POST['dob'])) {
if (substr_count($dob,'/') > 2 || checkdate((int)substr(zen_date_raw($dob), 4, 2), (int)substr(zen_date_raw($dob), 6, 2), (int)substr(zen_date_raw($dob), 0, 4)) == false) {
$error = true;
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
}
}
}
to something like:
Code:
if (ACCOUNT_DOB == 'true') {
if (ENTRY_DOB_MIN_LENGTH > 0 or !empty($_POST['dob'])) {
if (preg_match("/^([0-9]{4})(.)([0-9]{2})(.)([0-9]{2}$)/", $dob, $output_array)) {
$_POST['dob'] = substr($dob, 5, 2) . '/' . substr($dob, 8, 2) . '/' . substr($dob, 0, 4);
$dob = substr($dob, 5, 2) . '/' . substr($dob, 8, 2) . '/' . substr($dob, 0, 4);
}
if (substr_count($dob,'/') > 2 || checkdate((int)substr(zen_date_raw($dob), 4, 2), (int)substr(zen_date_raw($dob), 6, 2), (int)substr(zen_date_raw($dob), 0, 4)) == false) {
$error = true;
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
}
}
}
Bookmarks