-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add createFromFormat static method to CarbonInterval #1921
Add createFromFormat static method to CarbonInterval #1921
Conversation
Hi @xfudox, thanks for your PR, would you mind please adding unit tests for your feature. See as an example: Thanks |
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.
- Unit tests
- Fix PHPDoc
Hi @xfudox I had no time to fix the PHPDoc and add unit tests, so I postponed this for version 2.27. Thanks for your understanding. |
Yeah, sorry for I'm late, I've very little free time to work on this recently, hope to fix this asap. |
Hi @xfudox thanks for unit tests and doc. The unit tests are not passing in Travis. Can you have a look? |
Yeah @kylekatarnls , I'll take a look asap. |
Obviously, my solution (the macro proposition made in the issue) will only work with hours, not for day/month/year, so we actually need to parse the format in a custom way. I take the assignee to propose something else. |
Hi @xfudox can you check the new implementation? |
Added
createFromFormat
method toCarbonInterval
's core for #1918 .Useful to handle time interval strings like MySQL
time
field (e.g.: '10:20:00'):E.g.:
is equivalent to:
or