-
Notifications
You must be signed in to change notification settings - Fork 339
Bug/12385 monthly frequency #12414
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
base: develop
Are you sure you want to change the base?
Bug/12385 monthly frequency #12414
Changes from 5 commits
7e5766f
b6068dd
70eb76a
fe1ff61
3f5f57f
9745bdf
c893652
e6cf40a
ddd1443
042cdfc
dfd4276
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,12 +117,15 @@ public static function build_reference_dates( $frequency, $timestamp ) { | |
|
|
||
| $period_lengths = array( | ||
| Email_Reporting_Settings::FREQUENCY_WEEKLY => 7, | ||
| Email_Reporting_Settings::FREQUENCY_MONTHLY => 30, | ||
| Email_Reporting_Settings::FREQUENCY_QUARTERLY => 90, | ||
|
||
| ); | ||
|
|
||
| $period_days = isset( $period_lengths[ $frequency ] ) ? $period_lengths[ $frequency ] : $period_lengths[ Email_Reporting_Settings::FREQUENCY_WEEKLY ]; | ||
|
|
||
| if ( Email_Reporting_Settings::FREQUENCY_MONTHLY === $frequency ) { | ||
| $period_days = (int) $send_date->format( 't' ); | ||
| } | ||
|
|
||
| // endDate is inclusive, so startDate must be endDate - (period_days - 1) for an exact period-length window. | ||
| $start_date = $send_date->sub( new DateInterval( sprintf( 'P%dD', max( $period_days - 1, 0 ) ) ) ); | ||
| $compare_end_date = $start_date->sub( new DateInterval( 'P1D' ) ); | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.