"Previous month" of graph period does not work properly

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: None
    • Component/s: 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,

            Assignee:
            Zabbix Development Team
            Reporter:
            Kento Takahashi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: