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

Some minor improvements to SMF\Time #8366

Merged
merged 5 commits into from
Dec 21, 2024

Conversation

Sesquipedalian
Copy link
Member

@Sesquipedalian Sesquipedalian commented Dec 21, 2024

  1. Workaround for a PHP date parsing oddity in SMF\Time::__construct()

    • In some versions of PHP, unexpected results may be produced if the $datetime parameter contains the special now or ago keywords and also contains a time zone ID string (e.g. now Europe/Paris), but that time zone ID string is different than the one in the $timezone parameter. 66b5a3a deals with that.
  2. Improves input sanitization in SMF\Time::__construct()

    • This makes SMF\Time more robust than \DateTime in terms of the input it can accept. For example, the phrase "today at 5:30 pm" will actually work for constructing an SMF\Time object, whereas \DateTime would choke on the word "at" and fail.
  3. Adds support for 'tomorrow' as a relative date format

    • This is helpful when showing upcoming events.
  4. Moves Calendar::convertDateToEnglish() to Time::convertToEnglish()

    • It makes more sense as part of SMF\Time.
  5. Tidies away some backward compatibility methods in SMF\Time

    • Just some housekeeping.

@Sesquipedalian Sesquipedalian merged commit 7a78137 into SimpleMachines:release-3.0 Dec 21, 2024
6 checks passed
@Sesquipedalian Sesquipedalian deleted the 3.0/time branch December 21, 2024 05:17
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