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

Strange date time issues in customer view #466

Closed
seansan opened this issue Mar 9, 2018 · 2 comments
Closed

Strange date time issues in customer view #466

seansan opened this issue Mar 9, 2018 · 2 comments

Comments

@seansan
Copy link
Contributor

seansan commented Mar 9, 2018

Whilst thinking to fix a small error I ran into several strange issues occuring in customer edit view in adminthtml (customer/edit). Several things are unexpected. Let me explain

  • Local Time now is May 9 4:32 PM (UTC Now = May 9 3:32)
  • Local Timezone Amsterdam/Netherlands
  • Local Account creation date is July 27 2015 at 8:38 AM

Below are some strange things

  1. The last login date is very strange. Year is incorrect. Time is minutes off.
  2. The account creation date is not 7:38 AM it was 8:38 AM (i have also jus confirmed this by creating a new account. Even stranger , the order datetime is 4:32 PM but the account creation datetime - which occured at the same time - shows as 3:32 PM)

So there seem to be 2 problems

  1. getLastLoginDate / logindate date does not seem correct
    (however the localized LastLoginStore is! correct)
  2. but the same date getter for getStoreCreateDate is not! correct and is 1 hour off (here I would expect 2 lines als showing the alternative localized version)

I hope it is a little clear

image

this image was created by changing the if/else in Template for block Mage_Adminhtml_Block_Customer_Edit_Tab_View
image

possibly related: https://magento.stackexchange.com/questions/38143/customer-created-logged-in-timestamps-in-admin

@seansan
Copy link
Contributor Author

seansan commented Mar 9, 2018

Possible solution for 1.

  • formatdate() in Mage_Core_Helper_Data has a check for instanceof zend_date but the date passed in getLastLoginDate() in Mage_Adminhtml_Block_Customer_Edit_Tab_View is a member of Mage_Core_Helper_Data and thus returns false
  • As a result strtotime is performed on the date object here
  • A possible fix is to add the following to getLastLoginDate() here
        $date = $this->getCustomerLog()->getLoginAtTimestamp();
        if ($date) {
        $date = new Zend_Date($date, Zend_Date::TIMESTAMP);

@ADDISON74
Copy link
Contributor

I discovered this issue today in OpenMage 20.0.7 instance in production. A fix should be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants