Skip to content
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

Date of Birth attribute gets weird format on page reload #7778

Closed
killoff opened this issue Dec 13, 2016 · 10 comments
Closed

Date of Birth attribute gets weird format on page reload #7778

killoff opened this issue Dec 13, 2016 · 10 comments
Labels
bug report 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 Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@killoff
Copy link

killoff commented Dec 13, 2016

Preconditions

DOB attribute is optional or required in Stores Configuration

Steps to reproduce

  1. Go to customer registration form, fill in all fields, DOB as well (10.12.2016)
    Enter existing customer email in order to get an error.
  2. Submit form

Expected result

Date 10.12.2016 preserved on the form as DOB

Actual result

Date 10..0000000 preserved on the form as DOB

PS. smth wrong with Magento\Framework\Data\Form\Filter\Date::outputFilter()

...
        $filterInternal = new \Zend_Filter_NormalizedToLocalized(
            ['date_format' => $this->_dateFormat, 'locale' => $this->localeResolver->getLocale()]
        );

        $value = $filterInput->filter($value);
        $value = $filterInternal->filter($value);  // shit happens here
...
@vil11
Copy link

vil11 commented Dec 13, 2016

@killoff
thanks for reporting this issue! Internal number MAGETWO-62181.


dvilchynskyi, M2 QA

@vzabaznov vzabaznov added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report labels Dec 13, 2016
@JacobDrummond
Copy link

@vil11, related to #6323 ?

@vil11
Copy link

vil11 commented Dec 14, 2016

Probably the cause is similar, but #6323 is fixed while this one is still can be reproduced.

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 2.1.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 3, 2017
@magento-engcom-team
Copy link
Contributor

@killoff, thank you for your report.
We've created internal ticket(s) MAGETWO-62181 to track progress on the issue.

@nemesis-back
Copy link

I'm working on it #SQUASHTOBERFEST

@okorshenko
Copy link
Contributor

Hi @nemesis-back could you please accept the invite in the GitHub?

@nemesis-back
Copy link

@okorshenko accepted, thx

@kanduvisla
Copy link
Contributor

Although #11721 status that this issue is fixed in 2.2 (haven't tested this yet), I temporarily fixed this in a Magento 2.1 shop by adding an interceptor before \Magento\Customer\Block\Widget\Dob::setDate():

public function __construct(
    \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone
) {
    $this->timezone = $timezone;
}

public function beforeSetDate(\Magento\Customer\Block\Widget\Dob $subject, $date)
{
    // Reformat the time from frontend locale (nl_BE) to system locale (YYYY-MM-DD)
    return [$this->timezone->date($date)->format('Y-m-d')];
}

Hope this helps someone.

@arnoudhgz
Copy link
Contributor

Tested the current 2.2-develop branch, seems solved with this PR: #15272

It is part of the 2.2.6 Milestone.

Thanks to @KaushikChavda for creating the PR!!

@magento-engcom-team I think this issue can be closed.

@sdzhepa
Copy link
Contributor

sdzhepa commented May 1, 2019

@sdzhepa sdzhepa closed this as completed May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 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 Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

10 participants