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

Improvements to SMF\TimeInterval #8378

Merged

Conversation

Sesquipedalian
Copy link
Member

@Sesquipedalian Sesquipedalian commented Dec 26, 2024

  1. Adds support to SMF\TimeInterval for all \DateInterval methods
    This is tricker than one might expect, because of some very quirky behaviour in \DateInterval and how it handles its properties. In particular, calling parent::__construct() from a child class will clobber certain properties values and make them read-only. But not calling the parent constructor means that we must implement all of the parent's methods and properties in the child class.

  2. Adds SMF\TimeInterval::localize() method
    Formats the interval as a human-readable string in the current user's language.

@Sesquipedalian Sesquipedalian changed the title Adds support to SMF\TimeInterval for all \DateInterval methods Improvements to SMF\TimeInterval Dec 26, 2024
This is tricker than one might expect, because of some very quirky behaviour in \DateInterval and how it handles its properties. In particular, calling parent::__construct() from a child class will clobber certain properties values and make them read-only. But not calling the parent constructor means that we must implement all of the parent's methods and properties in the child class.
Signed-off-by: Jon Stovell <[email protected]>
@Sesquipedalian Sesquipedalian merged commit d64c717 into SimpleMachines:release-3.0 Dec 26, 2024
6 checks passed
@Sesquipedalian Sesquipedalian deleted the 3.0/timeinterval branch December 26, 2024 05:09
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.

1 participant