Skip to content
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 some more date / dateinterval utility functions #57

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

acoulton
Copy link
Member

No description provided.

DateIntervalUtils::toHuman() can render a string representation of (some)
DateInterval objects. Not all, because only some formats can be sensibly
converted back to a human-readable string.

DateIntervalFactory provides shorthand methods for creating from an
integer number of seconds / hours / days / monthsetc to reduce the
need for code like

`new DateInterval('PT'.$this->some_var.'M')`

and also to reduce the risk of confusing minutes and months.
@acoulton acoulton requested a review from craig410 October 17, 2023 12:02
@acoulton acoulton enabled auto-merge October 17, 2023 16:38
@acoulton acoulton merged commit 7fdedf1 into 1.x Oct 17, 2023
4 checks passed
@acoulton acoulton deleted the 1.x-feat-date-utils branch October 17, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants