Skip to content

Conversation

@AmineMx
Copy link

@AmineMx AmineMx commented Dec 29, 2025

When parsing date formats like "2026-02" that don't specify a day, DateTime::createFromFormat() was using the current day (29th) from the system date. This caused February 2026 to overflow to March 1st since February 2026 only has 28 days.

Adding the '!' prefix resets all date components to Unix Epoch before parsing, ensuring the day defaults to 1 instead of using the current day.

When parsing date formats like "2026-02" that don't specify a day,
DateTime::createFromFormat() was using the current day (29th) from
the system date. This caused February 2026 to overflow to March 1st
since February 2026 only has 28 days.

Adding the '!' prefix resets all date components to Unix Epoch before
parsing, ensuring the day defaults to 1 instead of using the current
day.
@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.49%. Comparing base (562d98d) to head (3c0ae8d).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1580   +/-   ##
=========================================
  Coverage     97.49%   97.49%           
  Complexity      986      986           
=========================================
  Files           205      205           
  Lines          2236     2236           
=========================================
  Hits           2180     2180           
  Misses           56       56           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@henriquemoody
Copy link
Member

Thank you for the changes, @AmineMx! 🐼

Could you fix the broken check, and add some tests to cover your changes?

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.

2 participants