Skip to content

Conversation

tasnim0tantawi
Copy link
Contributor

Changes in this pull request:

 if ('MTD' === $repeatFreq) {
            return $end->startOfMonth()->startOfDay();
        }

Updated this block to return the correct MTD (start of month) in Navigation.php.

@JC5

@tasnim0tantawi
Copy link
Contributor Author

image

@tasnim0tantawi
Copy link
Contributor Author

@JC5 I need your assistance on this one. The logic matches QTD and YTD.

@JC5
Copy link
Member

JC5 commented Aug 26, 2024

Looks OK to me, I'll check it out later this week. Thanks!

@JC5
Copy link
Member

JC5 commented Aug 27, 2024

Oh lol no the code change is required, it's the TEST that needs to be updated.

@tasnim0tantawi
Copy link
Contributor Author

tasnim0tantawi commented Aug 27, 2024

@JC5
I felt that. But I was very confused as MTD is more of a duration. And the tests are like this for MTD QTD YTD. YTD and QTD are passing. I thought they all follow the same logic.

  'MTD'                           => ['frequency' => 'MTD', 'from' => Carbon::now(), 'expected' => Carbon::now()->startOfMonth()->startOfDay()],
            'QTD'                           => ['frequency' => 'QTD', 'from' => Carbon::now(), 'expected' => Carbon::now()->firstOfQuarter()->startOfDay()],
            'YTD'                           => ['frequency' => 'YTD', 'from' => Carbon::now(), 'expected' => Carbon::now()->startOfYear()->startOfDay()],

May you please explain the logic of MTD YTD QTD to me and I will fix it?

@tasnim0tantawi
Copy link
Contributor Author

@JC5 Check this! I updated the tests for MTD.

@JC5 JC5 merged commit 6602601 into firefly-iii:develop Aug 31, 2024
1 check passed
@JC5
Copy link
Member

JC5 commented Aug 31, 2024

Nice work!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2024
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.

2 participants