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

Problem with local datetime format in js

XMLWordPrintable

      Time period filter has a problem with formatting timestamp to local datetime format.
      I've translated default format: 'd. m. Y H:i' http://www.zabbix.org/pootle/sk/Zabbix-trunk/LC_MESSAGES/frontend.po/translate/#search=d.%20m.%20Y%20H%3Ai&sfields=source,target
      Another languages are OK. They don't have translated format or they have standard English format 'Y-m-d H:i' - it can be also workaround.
      Probably function format of CDate class has some bug. Problem tested on current version of Firefox and Internet Explorer and rev 46285 (svn checkout):
      Problem code:
      setTabInfo: function() {
      var period = timeControl.timeline.period(),
      usertime = timeControl.timeline.usertime();
      // secure browser from incorrect user actions
      if (isNaN(period) || isNaN(usertime))

      { return; }

      this.dom.info_period.innerHTML = formatTimestamp(period, false, true);
      // info left
      var userStartTime = usertime - period;
      this.dom.info_left.innerHTML = new CDate(userStartTime * 1000).format(locale['S_DATE_FORMAT']);
      this.dom.info_left.setAttribute('data-timestamp', userStartTime);
      // info right
      var right_info = new CDate(usertime * 1000).format(locale['S_DATE_FORMAT']);
      this.dom.info_right.setAttribute('data-timestamp', usertime);
      if (timeControl.timeline.now())

      { right_info += ' (' + locale['S_NOW_SMALL'] + '!) '; }

      this.dom.info_right.innerHTML = right_info;
      // seting zoom link styles
      this.setZoomLinksStyle();
      },

            Unassigned Unassigned
            jan.garaj Jan Garaj
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: