Skip to content

feat: I18n\Time::addCalendarMonth #9527

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

Conversation

christianberkman
Copy link
Contributor

The Time::addMonths() could return an undesired behaviour if a date in the next calandar month is desired. For example, Time(2025-01-31)->addMonths(1) results in 2025-03-03 while a date in february may be desired, or Time(2025-03-31)->addMonths(1) results in a date in May not in April. Of course, this only applies if the dev is looking for a date in the next calendar month (months are weird of course, it is 30, 31, 28, 29 days...? who knows).

Comparison

Initial date: 2025-01-31
+---------+------------+-------------------+
| $months | addMonths  | addCalendarMonths |
+---------+------------+-------------------+
| 0       | 2025-01-31 | 2025-01-31        |
| 1       | 2025-03-03 | 2025-02-28        |
| 2       | 2025-03-31 | 2025-03-31        |
| 3       | 2025-05-01 | 2025-04-30        |
| 4       | 2025-05-31 | 2025-05-31        |
| 5       | 2025-07-01 | 2025-06-30        |
| 6       | 2025-07-31 | 2025-07-31        |
| 7       | 2025-08-31 | 2025-08-31        |
| 8       | 2025-10-01 | 2025-09-30        |
| 9       | 2025-10-31 | 2025-10-31        |
| 10      | 2025-12-01 | 2025-11-30        |
| 11      | 2025-12-31 | 2025-12-31        |
| 12      | 2026-01-31 | 2026-01-31        |
| 13      | 2026-03-03 | 2026-02-28        |
+---------+------------+-------------------+

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

If deemed worthy to include I will write test and documentation.

michalsn and others added 9 commits February 25, 2025 20:58
* -revert: auto corrected (composer cs-fix) comments and auto added function return types
-comment: add depreceation comment for failedSMTPLogin email error message
-refactor: improve authorization validation flow and email error response messages
-added $SMTPAuthMethod in Config\Email file with default value of login

* Update system/Email/Email.php

apply suggestion for declaring string type of $SMTPAuthMethod

Co-authored-by: John Paul E. Balandan, CPA <[email protected]>

* Update user_guide_src/source/libraries/email.rst

Apply Suggestion for description of SMTPAuthMethod

Co-authored-by: Michal Sniatala <[email protected]>

* docs: update changelog

* fix: php-cs violations

* Update user_guide_src/source/changelogs/v4.7.0.rst

Apply suggestions for changelog

Co-authored-by: Michal Sniatala <[email protected]>

---------

Co-authored-by: John Paul E. Balandan, CPA <[email protected]>
Co-authored-by: Michal Sniatala <[email protected]>
@christianberkman
Copy link
Contributor Author

Wrong branch.

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.

4 participants