Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fixed an issue with datetimeimmutable comparaison #180

Merged
merged 2 commits into from
Jan 6, 2020

Conversation

Kharhamel
Copy link
Collaborator

This pr solves #179

@Kharhamel Kharhamel changed the title implemented another datetimeimmutable test WIP: fixed an issue with datetimeimmutable comparaison Jan 6, 2020
@Kharhamel Kharhamel changed the title WIP: fixed an issue with datetimeimmutable comparaison fixed an issue with datetimeimmutable comparaison Jan 6, 2020
@Kharhamel Kharhamel force-pushed the fix/datetimeImmutable branch from 9e8f9cf to efc05a2 Compare January 6, 2020 13:03
@Kharhamel Kharhamel force-pushed the fix/datetimeImmutable branch 2 times, most recently from e5e50d2 to 1dcd0e9 Compare January 6, 2020 13:37
@Kharhamel Kharhamel merged commit b2d2b66 into thecodingmachine:master Jan 6, 2020
$this->innerDateTime = new parent($time, $timezone);
}

//switch from regular datetime to safe version
private static function createFromRegular(\DateTimeImmutable $datetime): self
{
$safeDatetime = new self();
$safeDatetime = new self($datetime->format('Y-m-d H:i:s'), $datetime->getTimezone()); //we need to also update the wrapper to not break the operators '<' and '>'

Choose a reason for hiding this comment

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

what about microseconds?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

damn i forgot about theses

Copy link
Contributor

Choose a reason for hiding this comment

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

So milliseconds can't be used with < 7.4 because ::createFromFormat doesn't accept it, microseconds should be used.

@kunicmarko20
Copy link
Contributor

@Kharhamel thank you for fast response, can we potentially get a patch release with this?

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

Successfully merging this pull request may close these issues.

3 participants