[ZBX-12019] Frontend incorrectly displays calendar in maintenance edit form when system time zone is ahead of PHP timezone Created: 2017 Apr 05  Updated: 2017 Jun 05  Resolved: 2017 Jun 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 3.0.9rc1, 3.4.0alpha1
Fix Version/s: 3.0.10rc1, 3.2.7rc1, 3.4.0alpha1

Type: Problem report Priority: Minor
Reporter: Glebs Ivanovskis (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: maintenance, timezone, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File calendar.png     PNG File done.png    
Sprint: Sprint 5, Sprint 6, Sprint 7, Sprint 8, Sprint 9
Story Points: 1

 Description   

Definitely affects trunk, most likely affects other versions too, but I have not checked.

To reproduce you need to set different time zones in php.ini file and system-wide, system time zone must be ahead of PHP date.timezone, for example:

$ cat /etc/php/7.0/apache2/php.ini | grep 'date\.timezone ='
date.timezone = Europe/Riga
$ cat /etc/timezone
Asia/Tokyo

Then go to Configuration->Maintenance and press Create maintenance period.

Press the little calendar button next to Active since or Active till settings.

You will see that day in the calendar is by one less than day in the input field:

If you press Done this incorrect day will propagate into input field:

P.S. Since web server and web browser are running on the same system in my case, I don't know which of them is affected by system settings. But these is clearly some JavaScript client - JavaScript server - PHP magic going on.
P.P.S. Strangely, this calendar selector is used in many places across frontend (e.g. in graphs and screens), but only maintenance form seems to be affected.



 Comments   
Comment by Oleksii Zagorskyi [ 2017 Apr 05 ]

There are many related discussions, like ZBX-8178, ZBX-4437. ZBX-5939 has some useful notes for troubleshooting

Comment by Glebs Ivanovskis (Inactive) [ 2017 Apr 10 ]

Tested on a separate web server. PHP timezone is UTC, web server system timezone is UTC too. If my timezone is Europe/Riga the issue still exists. If I change my timezone to UTC (or any timezone West of UTC) the issue disappears. So, client timezone is what matters.

Comment by Miks Kronkalns [ 2017 Apr 11 ]

(1) No translation string changes.

iivs CLOSED

Comment by Miks Kronkalns [ 2017 Apr 11 ]

Date-picker should be retested also in other places where it appears.

Comment by Miks Kronkalns [ 2017 Apr 11 ]

RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-12019

Comment by Ivo Kurzemnieks [ 2017 May 22 ]

(2) L267-271: To my understanding the code is redundant. The function it self is only called in places where there is no timebar. If no TZ recalculation is required, then no code is needed. I'd say remove it, check again. The coding style for added code is also wrong.

Miks.Kronkalns RESOLVED in r68502.

iivs CLOSED

Comment by Miks Kronkalns [ 2017 Jun 01 ]

Fixed:

  • 3.0.10rc1 r68825
  • 3.2.7rc1 r68827
  • 3.4.0alpha1 (trunk) r68828
Comment by Glebs Ivanovskis (Inactive) [ 2017 Jun 05 ]

Dear Miks.Kronkalns, since you've been looking at calendar related code, can you comment on whether ZBX-11362 can occur after your changes?

Generated at Tue Apr 23 14:07:40 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.