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

Support DateTimeImmutable inputs #211

Open
scy opened this Issue Oct 8, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@scy

scy commented Oct 8, 2018

My application uses \DateTimeImmutable instead of \DateTime. When using this library, e.g. to create a worklog, I have to convert my objects before being able to use them, which is rather ugly:

$worklog->setStartedDateTime(new \DateTime($immutable->format(\DateTime::ATOM)));

Since I assume you're not manipulating these \DateTime objects, but just read them, your code should be able to deal with \DateTimeImmutable without any modifications as well. PHP ≥ 5.5 provides \DateTimeInterface as a common base to make this easier.

I'm willing to implement this myself. Let me know if you're interested in a PR.

@lesstif

This comment has been minimized.

Show comment
Hide comment
@lesstif

lesstif Oct 9, 2018

Owner

Hi @scy,

that's a good point, if you to generate PR, i will merge it.

thanks.

Owner

lesstif commented Oct 9, 2018

Hi @scy,

that's a good point, if you to generate PR, i will merge it.

thanks.

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