Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion activity_hub.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

// Get the project transitions for the number of projects completed today
// set the timestamp representing the start of today
$t_start_of_today = mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'));
$t_start_of_today = mktime(0, 0, 0, idate('m'), idate('d'), idate('y'));

// For transition events (event_type = 'transition'), details2 gives
// the project's new state.
Expand Down
4 changes: 2 additions & 2 deletions pinc/graph_data.inc
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ function curr_month_proj(string $which): array

$todaysTimeStamp = time();

$year = (int) date("Y", $todaysTimeStamp);
$month = (int) date("m", $todaysTimeStamp);
$year = idate("Y", $todaysTimeStamp);
$month = idate("m", $todaysTimeStamp);
$monthVar = _(date("F", $todaysTimeStamp));
$timeframe = "$monthVar $year";

Expand Down
10 changes: 5 additions & 5 deletions pinc/theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,8 @@ function show_completed_projects(bool $terse = false): void
echo "<table>\n";
$num_months = 12;
}
$thismonth = (int)date("n");
$thisyear = (int)date("Y");
$thismonth = idate("n");
$thisyear = idate("Y");
for ($months_ago = 0; $months_ago <= $num_months; $months_ago++) {
// midnight that begins the 1st day of this month and the next:
$begindate = mktime(0, 0, 0, $thismonth - $months_ago, 1, $thisyear);
Expand Down Expand Up @@ -1111,14 +1111,14 @@ function calculate_progress_bar_properties(int $actual, int $goal, bool|string $

// Calculate the progress bar color scaling based on the time of day.
if ($prorate_goal_for_color == 'bar' || $prorate_goal_for_color === true) {
$t_start_of_today = mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'));
$t_start_of_today = mktime(0, 0, 0, idate('m'), idate('d'), idate('y'));
$fraction_of_time_passed = (time() - $t_start_of_today) / (60 * 60 * 24);
// Note: Calculation assumes a 24-hour day which is true except
// possibly for the first and last days of daylight saving time
// depending on how PHP calculates DST in the mktime() call.
} elseif ($prorate_goal_for_color == 'month') {
$t_start_of_month = mktime(0, 0, 0, (int)date('m'), 1, (int)date('y'));
$fraction_of_time_passed = (time() - $t_start_of_month) / (60 * 60 * 24 * date("t"));
$t_start_of_month = mktime(0, 0, 0, idate('m'), 1, idate('y'));
$fraction_of_time_passed = (time() - $t_start_of_month) / (60 * 60 * 24 * idate("t"));
} else {
$fraction_of_time_passed = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion stats/pp_stage_goal.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function _get_pages_posted_data(int $start_timestamp): int
}

// Get the total pages for projects that have posted in current month
$start_timestamp = mktime(0, 0, 0, (int)date('m'), 1, (int)date('Y'));
$start_timestamp = mktime(0, 0, 0, idate('m'), 1, idate('Y'));
// cache pages posted data for 1 hour
$pp_pages_total = memoize_function("_get_pages_posted_data", [$start_timestamp], 60 * 60);

Expand Down