-
Notifications
You must be signed in to change notification settings - Fork 9.4k
fix date calculation for report's years interval #22868
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
fix date calculation for report's years interval #22868
Conversation
Date->diff returns amount of full years between dates, so when dateStart = 2018-12-25 and dateEnd = 2019-01-25 $dateStart->diff($dateEnd)->y will be 0, that does not match the code's logic which expects 1 when year 'from' is not eq to year 'to'
Hi @polkan-msk. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @polkan-msk,
Thank you for your contribution!
Your PR looks really great!
But we need to have green build to process the PR.
Could you please check and fix failed static tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@polkan-msk,
Thank you for your changes.
QA, the main idea of the bug that if you select year period in '01-01-2018 - 14-05-2019' it will show statistic for 2 periods: '01-01-2018 - 14-05-2018' and '01-01-2019 - 14-05-2019'
Hi @swnsma, thank you for the review. |
@polkan-msk thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
✔️ QA Passed |
Hi @polkan-msk, thank you for your contribution! |
Description (*)
Date->diff returns amount of full years between dates, so when
dateStart = 2018-12-25 and dateEnd = 2019-01-25
$dateStart->diff($dateEnd)->y will be 0, that does not match the code's
logic which expects 1 when year 'from' is not eq to year 'to'
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)