Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-20837

"Previous month" of graph period does not work properly

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • None
    • Frontend (F)
    • None

      It may be the same problem as ZBX-20197 but this is the problem in frontend.

      When "Previous month" in graph range is selected on March 29-31, the graph shows from March 1 to 31.
      It should show from February 1 to 28.

      This is caused by DateTime::modify() in php.

      echo (new Datetime("2022-03-29"))->modify("-1 month")->format("Y-m-d\n");
      
      2022-03-01
      

      I made a patch for this problem. It is based on the example in the php manual https://www.php.net/manual/en/datetime.modify.php#120513
      Could you please confirm it?

      Regards,

            zabbix.dev Zabbix Development Team
            kento.takahashi Kento Takahashi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: