ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-2372

Function "zbx_date2str" wrongly convert long name of month "May"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.3
    • Fix Version/s: 1.8.3
    • Component/s: Frontend (F)
    • Labels:
      None
    • Environment:
      after revision 11583 (changed zbx_date2str function).
      In locales where the full name of the month of "May" is longer than three letters. ;)

      Description

      In locales where the length of the name of the month of May is longer than three letters, rather than the short name of the month long display.
      This is because in sequential replacement of names in the function "zbx_date2str" replacement of the month of May at the long name is always.
      $output = str_replace(date('F',$value), $monthslong[date('n',$value)], $output);

      See screenshort.
      Please Fix the logic of replacement names.

      On locales EN, RU this bug is not visible (visible as normal).

        Activity

        Hide
        Oleksiy Zagorskyi added a comment - - edited

        String from UA locale:

        'S_TIMELINE_DATE_FORMAT'=> 'd.M',

        'S_MONTH_MAY_SHORT'=> 'Тра',
        'S_MONTH_MAY_LONG'=> 'Травень',

        Show
        Oleksiy Zagorskyi added a comment - - edited String from UA locale: 'S_TIMELINE_DATE_FORMAT'=> 'd.M', 'S_MONTH_MAY_SHORT'=> 'Тра', 'S_MONTH_MAY_LONG'=> 'Травень',
        Hide
        Maxim Andruhovich added a comment -

        svn://svn.zabbix.com/branches/dev/ZBX-2372

        Show
        Maxim Andruhovich added a comment - svn://svn.zabbix.com/branches/dev/ZBX-2372
        Hide
        Oleksiy Zagorskyi added a comment -

        from branches/dev/ZBX-2372. Now ALL 12 months are displayed as short name May 'S_MONTH_MAY_SHORT'

        Show
        Oleksiy Zagorskyi added a comment - from branches/dev/ ZBX-2372 . Now ALL 12 months are displayed as short name May 'S_MONTH_MAY_SHORT'
        Hide
        Maxim Andruhovich added a comment -

        Sorry this were phrases misspelling, wrong phrase used in char4.php, not a function problem, now everything should work fine, check rev 12058

        Show
        Maxim Andruhovich added a comment - Sorry this were phrases misspelling, wrong phrase used in char4.php, not a function problem, now everything should work fine, check rev 12058
        Hide
        Maxim Andruhovich added a comment -

        If you have such problems more, please post screen shot or tell me file name which draws chart

        Show
        Maxim Andruhovich added a comment - If you have such problems more, please post screen shot or tell me file name which draws chart
        Hide
        Oleksiy Zagorskyi added a comment -

        'S_MONTH_MAY_LONG'=> 'Травень',
        'S_MONTH_MAY_SHORT'=> 'Тра',

        I think problem in function. See screnshot report2-zbx2372-r12061

        Show
        Oleksiy Zagorskyi added a comment - 'S_MONTH_MAY_LONG'=> 'Травень', 'S_MONTH_MAY_SHORT'=> 'Тра', I think problem in function. See screnshot report2-zbx2372-r12061
        Hide
        Maxim Andruhovich added a comment - - edited

        Currently there is no problem in the function zbx_date2str (rev 12058).

        On your screen shot you can see when format is "d F" at the end of "time line" there is no data and month is full as expected and goes over chart grid, but at the beginning data goes over time line labels, so data hiding time line labels.

        Our charts has predefined space for labels so month should be no longer than 3 symbols in length.

        Please, use another date format for you charts.

        Show
        Maxim Andruhovich added a comment - - edited Currently there is no problem in the function zbx_date2str (rev 12058). On your screen shot you can see when format is "d F" at the end of "time line" there is no data and month is full as expected and goes over chart grid, but at the beginning data goes over time line labels, so data hiding time line labels. Our charts has predefined space for labels so month should be no longer than 3 symbols in length. Please, use another date format for you charts.
        Hide
        Oleksiy Zagorskyi added a comment -

        Maxim,
        I have no complaints about the format "d F". It just for an example.

        On three different images simply by changing the format 'S_CHART4_TIMELINE_DATE_FORMAT'
        Format "d.m" display correct.
        And why the "d M" format is displayed that all 12 months look the same (Тра)?

        I do not open a query, but the problem remained. What am I wrong?

        Show
        Oleksiy Zagorskyi added a comment - Maxim, I have no complaints about the format "d F". It just for an example. On three different images simply by changing the format 'S_CHART4_TIMELINE_DATE_FORMAT' Format "d.m" display correct. And why the "d M" format is displayed that all 12 months look the same (Тра)? I do not open a query, but the problem remained. What am I wrong?
        Hide
        Maxim Andruhovich added a comment - - edited

        Yep, you are right.

        I don't know why, I made caching of the replacement data, at the moment I fixed this issue, check how it works now in rev 12075.

        Sorry, for misunderstanding

        Show
        Maxim Andruhovich added a comment - - edited Yep, you are right. I don't know why, I made caching of the replacement data, at the moment I fixed this issue, check how it works now in rev 12075. Sorry, for misunderstanding
        Hide
        Oleksiy Zagorskyi added a comment -

        Maxim, thanks.
        I checked all three formats of the month (m M F).
        Now all fine.

        Show
        Oleksiy Zagorskyi added a comment - Maxim, thanks. I checked all three formats of the month (m M F). Now all fine.
        Hide
        Maxim Andruhovich added a comment -

        Bug fixed in version pre 1.8.3 revision 12532

        Show
        Maxim Andruhovich added a comment - Bug fixed in version pre 1.8.3 revision 12532

          People

          • Assignee:
            Maxim Andruhovich
            Reporter:
            Oleksiy Zagorskyi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: