Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix date issues once and for all#7055

Merged
lcobucci merged 2 commits into
doctrine:masterfrom
lcobucci:fix-date-issues-once-and-for-all
Feb 9, 2018
Merged

Fix date issues once and for all#7055
lcobucci merged 2 commits into
doctrine:masterfrom
lcobucci:fix-date-issues-once-and-for-all

Conversation

@lcobucci
Copy link
Copy Markdown
Member

@lcobucci lcobucci commented Feb 9, 2018

Maybe now things will work properly...

@lcobucci lcobucci added the Bug label Feb 9, 2018
@lcobucci lcobucci added this to the 2.6.1 milestone Feb 9, 2018
@lcobucci lcobucci self-assigned this Feb 9, 2018
@lcobucci lcobucci requested a review from Majkl578 February 9, 2018 16:00
@lcobucci
Copy link
Copy Markdown
Member Author

lcobucci commented Feb 9, 2018

@Majkl578 I've added to v2.6.1 because I'm ready to backport it.


self::assertEquals($expectedValue, $diff, '', $delta);
self::assertEquals(
(new DateTimeImmutable($result['now']))->modify(sprintf('+%d %s', $amount, $unit)),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik CS currently prefers \DateTimeImmutable instead of use for global types, but allows both. https://github.com/doctrine/coding-standard/blob/3.0.0/lib/Doctrine/ruleset.xml#L158

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stupid IDE config HAHAHA, will change, thanks!

Now using PHP to calculate the expected date manipulation, keeping a day
as delta since PHP resets the hour when performing operations with
days/weeks/months/years.

February is a wonderful month, isn't it?
For the DATE_SUB() and DATE_ADD() functions.
@lcobucci lcobucci force-pushed the fix-date-issues-once-and-for-all branch from 608a9b4 to 9753421 Compare February 9, 2018 16:18
Copy link
Copy Markdown
Contributor

@Majkl578 Majkl578 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis failure unrelated.

@lcobucci lcobucci merged commit 06ffd85 into doctrine:master Feb 9, 2018
@lcobucci lcobucci deleted the fix-date-issues-once-and-for-all branch February 9, 2018 16:47
lcobucci added a commit to lcobucci/doctrine2 that referenced this pull request Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants