Skip to content

Change to Magento\Customer\Block\Widget\Dob new version  #518

Closed
@sepple

Description

@sepple

See #492

Magento\Customer\Block\Widget\Dob

public function getSortedDateInputs()
{
...
}

The function does not support keeping format characters provided by the locale date format string. In themes altering the form to use date input with an inline style like I do (http://mdev.sites.freelancer-stuttgart.de/customer/account/create/) the stripping is not desired.

I see two possible modifications to get support for this:

a) Put an optional argument to the function:
public function getSortedDateInputs ($stripNonInputChars = true)
and modify mapping like
$mapping = array(
'/m{1,5}/i' => '%1$s',
'/e{1,5}/i' => '%2$s',
'/d{1,5}/i' => '%2$s',
'/y{1,5}/i' => '%3$s',
);
if ($stripNonInputChars)
$mapping[] = '/[^medy]/i' => '\1';

b) Introduce a new function called getFormattedDateInputs or anything like this. Just the same function as getSortedDateInputs but without the mapping '/[^medy]/i' => '\1'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions