Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

fix: fix months discrimination #560

Merged
merged 1 commit into from May 31, 2023
Merged

fix: fix months discrimination #560

merged 1 commit into from May 31, 2023

Conversation

asbiin
Copy link
Member

@asbiin asbiin commented May 31, 2023

Months like Februar are discriminated.
Each end of the month, their Life Metrics won't display, they are not welcome ... because of their size. The Carbon::now()->month($month)->day(1) code would just skip Februar (and sometimes April, June, etc.), just because you're currently in a bigger month. This is pure discrimination.
This PR brings back justice in this world.
For all monthkind.

@asbiin
Copy link
Member Author

asbiin commented May 31, 2023

FYI this was discovered due to a failing test:

1) Tests\Unit\Domains\Vault\ManageLifeMetrics\Web\ViewHelpers\VaultLifeMetricsViewHelperTest::it_gets_the_data_needed_for_the_data_transfer_object
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
     0 => Array (...)
     1 => Array (
         'id' => 2
-        'friendly_name' => 'Feb'
+        'friendly_name' => 'Mar'
         'events' => 1
     )
     2 => Array (...)

/home/runner/work/chandler/chandler/tests/Unit/Domains/Vault/ManageLifeMetrics/Web/ViewHelpers/VaultLifeMetricsViewHelperTest.php:92
/home/runner/work/chandler/chandler/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:174

@sonarcloud
Copy link

sonarcloud bot commented May 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@asbiin asbiin merged commit 2cb1854 into main May 31, 2023
14 checks passed
@asbiin asbiin deleted the 20230531-fix-month branch May 31, 2023 07:00
asbiin added a commit to monicahq/monica that referenced this pull request Jun 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant