MantisBT: master 92d4e16c

Author Committer Branch Timestamp Parent
dregad dregad master 2024-10-11 13:10 master 5604e91e
Affected Issues  0034829: Graph plugin: deprecated strftime() in View Issues > issue trends
Changeset

Refactor the Period class to use DateTime objects

The code now relies on DateTimeImmutable::modify() instead of custom
logic based on strftime(), mktime() and getdate() to calculate the
various period types' start and end timestamps.

This fixes the deprecation warnings caused by calls to strftime() on
PHP 8.1 or later.

The methods returning formatted dates now use $g_normal_date_format
config, instead of hardcoded, custom date formats. This fixes display
of the selected date in the input fields when reloading the page after
submitting the form.

Code cleanup: fix static analysis warnings, improve PHPDoc.

Fixes 0034829

mod - plugins/MantisGraph/core/Period.php Diff File