View Issue Details

IDProjectCategoryView StatusLast Update
0037136mantisbtplug-inspublic2026-05-18 04:52
Reporterkhushal Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionduplicate 
Summary0037136: Replace deprecated strftime() with date() in MantisGraph Period class
Description

The Period class in the MantisGraph plugin uses strftime() to format
period start/end boundaries. strftime() was deprecated in PHP 8.1 and
removed in PHP 9.0, so it emits deprecation notices on PHP 8.1+ and
will fatal on PHP 9.0.

Replace all strftime() calls in plugins/MantisGraph/core/Period.php
with equivalent, output-preserving date() calls:

  • '%Y-%m-%d 23:59:59' -> 'Y-m-d 23:59:59'
  • '%Y-%m-%d 00:00:00' -> 'Y-m-d 00:00:00'
  • '%Y-%m-%d' -> 'Y-m-d'

Affected methods: a_week(), a_month(), month_to_date(), a_quarter(),
quarter_to_date(), a_year(), year_to_date(), get_start_formatted(),
get_end_formatted().

TagsNo tags attached.

Relationships

duplicate of 0034829 assigneddregad Graph plugin: deprecated strftime() in View Issues > issue trends 

Activities

dregad

dregad

2026-05-18 04:52

developer   ~0071128

Please note that Issue trend graphs are kind of broken at the moment, and it's much more than just the strftime deprecation. See 0025681, 0034879 and related issues, The most important problem being that no graphs are displayed...

This reminded me that I started a work-in-progress branch to fix the above, including a refactoring of the Period class to use DateTime objects (which would fix the deprecation). I started working on that in late 2024, but kind of forgot about it... So thanks for the heads up.

With regards to your PR https://github.com/mantisbt/mantisbt/pull/2223, I'd much rather finalize my work, than commit a quick targeted fix that will not only introduce conflicts in the refactoring branch but also leave the Issue Trends functionality in the not-really-usable state it is in at the moment. So if you'd like to contribute you are welcome to test and provide feedback on my code (see https://github.com/dregad/mantisbt/tree/fix-period, I'll try to update the branch later)

Anyway this is a duplicate of 0034829 so I'm resolving the Issue.