-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Period start
and end
always wrong with Carbon 3
#2982
Comments
bakerkretzmar
changed the title
Period start and end always wrong with Carbon 3
Period Mar 27, 2024
start
and end
always wrong with Carbon 3
It's because now I recommend you use the getters: [
Carbon::parse('Sep 1')->toPeriod('Sep 30')->getStartDate(),
Carbon::parse('Sep 1')->toPeriod('Sep 30')->getEndDate(),
]; |
We can make it correct at creation and then |
Thanks! 🙏🏻 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Carbon 3 the
start
andend
properties of a CarbonPeriod or CarbonPeriodImmutable are always2000-01-01
andnull
.Sandbox example.
Code to reproduce the issue:
Carbon version: 3.1.1
PHP version: 8.2.15
Expected (and what Carbon 2 returns):
Received:
The text was updated successfully, but these errors were encountered: