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

[Backport] Remove the timezone from the date when retrieving the current month from a UTC timestamp. #16584

Merged
merged 1 commit into from
Jul 13, 2018

Conversation

mageprince
Copy link
Contributor

Original Pull Request

#16492
Remove the timezone from the date when retrieving the current month from a UTC timestamp.

Description

When viewing "Ordered Products Report" on a monthly basis, the date range used does not always include the last day of the month. The reason for this is because the method used to retrieve the number of days in a month converts the startDate of 2018-05-01 00:00:00 Australia/Adelaide
into a UTC timestamp which changes the month. Therefore the timestamp needs to be retrieved from a datetime that is in UTC with the correct month specified.

The proposed solution in issue #15940 of using cal_days_in_month will not always work if PHP is compiled without calendar support.

Fixed Issues

  1. Wrong end of month at Reports for Europe/Berlin time zone if month contains 31 day #15940: Wrong end of month at Reports for Europe/Berlin time zone if month contains 31 day

Manual testing scenarios

Testing scenario provided in issue was used. Copied here for simplicity:

Preconditions

  1. Set Timezone "Central European Standard Time (Europe/Berlin)" at the STORE->CONFIGURATION->GENERAL->General->Local options-> Timezone and save configuration
  2. Create orders at 31-st day of a month which has this date (May will be used for example)

Steps to reproduce

  1. Go to the Reports adminhtml menu "Products">"Ordered" grid
  2. Select "From" - 01.05.2018
  3. Select "To" - 31.05.2018
  4. Select "Show by" - Month
  5. Hit refresh

Expected result
Orders that were created at 31.05.2018 are in the grid

Actual result
Orders that were created at 31.05.2018 are NOT in the grid

@magento-engcom-team
Copy link
Contributor

Hi @mageprince. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Contributor

Hi @miguelbalparda, thank you for the review.
ENGCOM-2215 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

Hi @mageprince. Thank you for your contribution.
We will aim to release these changes as part of 2.2.6.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

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

Successfully merging this pull request may close these issues.

4 participants