Skip to content

Commit

Permalink
Merge pull request #3 from effone/leading-zero
Browse files Browse the repository at this point in the history
Leading Zero Issue
  • Loading branch information
effone authored Dec 25, 2020
2 parents d851506 + 4d54568 commit 2324f89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dist/inc/plugins/birthday_week.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function birthday_week_populate()
global $templates;
$birthweek = array();
for ($i = 0; $i < 7; $i++) {
$birthweek[] = date('d-m', strtotime(sprintf("this week +%u days", $i)));
$birthweek[] = date('j-n', strtotime(sprintf("this week +%u days", $i)));
}
$birthday_week_data = array_intersect_key($birthdays, array_flip($birthweek));
$birthday_week_data = array_merge_recursive(...array_values($birthday_week_data));
Expand Down Expand Up @@ -140,7 +140,7 @@ function birthday_week_cache()
$birthdays = $birthweek = array();

for ($i = -1; $i < 8; $i++) { // Consider extra days on both side for timezone difference
$birthweek[] = date('d-m', strtotime(sprintf("this week +%u days", $i)));
$birthweek[] = date('j-n', strtotime(sprintf("this week +%u days", $i)));
}
array_walk($birthweek, function (&$value, $key) {
$value = "'" . $value . "-%'";
Expand Down

0 comments on commit 2324f89

Please sign in to comment.