Skip to content

Commit

Permalink
first badge was added for november 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
ilicfilip committed Feb 7, 2025
1 parent fb9fcf1 commit 1cf1062
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classes/badges/class-monthly.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public static function init_badges() {
}

$activation_date = \progress_planner()->get_base()->get_activation_date();
$start_date = $activation_date->modify( 'first day of this month' );
if ( $activation_date < new \DateTime( 'first day of November 2024' ) ) { // When badges were introduced.
$start_date = $activation_date->modify( 'first day of November 2024' );
} else {
$start_date = $activation_date->modify( 'first day of this month' );
}

// Year when plugin was released.
$end_date = ( 2024 === (int) $start_date->format( 'Y' ) && 2024 === (int) \gmdate( 'Y' ) )
Expand Down

0 comments on commit 1cf1062

Please sign in to comment.