[ZBX-2372] Function "zbx_date2str" wrongly convert long name of month "May" Created: 2010 Apr 23  Updated: 2017 May 30  Resolved: 2010 May 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 1.8.3
Fix Version/s: 1.8.3

Type: Incident report Priority: Major
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

after revision 11583 (changed zbx_date2str function).
In locales where the full name of the month of "May" is longer than three letters.


Attachments: PNG File report2-zbx2372-r12061.png     PNG File short_month_MAY_incorrect.png    

 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).



 Comments   
Comment by Oleksii Zagorskyi [ 2010 Apr 23 ]

String from UA locale:

'S_TIMELINE_DATE_FORMAT'=> 'd.M',

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

Comment by Maxim Andruhovich (Inactive) [ 2010 May 13 ]

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

Comment by Oleksii Zagorskyi [ 2010 May 13 ]

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

Comment by Maxim Andruhovich (Inactive) [ 2010 May 18 ]

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

Comment by Maxim Andruhovich (Inactive) [ 2010 May 18 ]

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

Comment by Oleksii Zagorskyi [ 2010 May 19 ]

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

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

Comment by Maxim Andruhovich (Inactive) [ 2010 May 19 ]

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.

Comment by Oleksii Zagorskyi [ 2010 May 19 ]

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?

Comment by Maxim Andruhovich (Inactive) [ 2010 May 19 ]

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

Comment by Oleksii Zagorskyi [ 2010 May 19 ]

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

Comment by Maxim Andruhovich (Inactive) [ 2010 Jun 03 ]

Bug fixed in version pre 1.8.3 revision 12532

Generated at Sat Apr 20 19:25:58 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.