cakephp / chronos

A standalone DateTime library originally based off of Carbon
http://book.cakephp.org/chronos
MIT License
1.34k stars 61 forks source link

add halfOfYear, isFirstHalfOfYear, IsSecondHalfOfYear; improve getter… #421

Closed brenoroosevelt closed 9 months ago

brenoroosevelt commented 10 months ago

I would like to propose the inclusion of the halfOfYear property and the isFirstHalfOfYear and isSecondHalfOfYear methods. The first half of the year corresponds to the first 6 months, while the second half corresponds to the remaining months.

Furthermore, I've made some improvements to the type hinting of the read-only properties in order to specify the numeric range. For example, changing daysInMonth from int to int<1, 31>. This allows for better static code analysis by PHPStan and Psalm.

Thank you in advance.

brenoroosevelt commented 10 months ago

@othercorey Changes made. renamed to 'half'

othercorey commented 9 months ago

Thanks!