Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-121123 Lightning Viewer Example Issues (V1)
  3. QTBUG-121011

Lightning Viewer Example: Bug on Calculation of Time Duration

    XMLWordPrintable

Details

    • c1962e919 (dev), cc1ae010d (6.7)

    Description

      The bug exists in DistanceTimeLayer.qml, and the following lines:

      92:  duration_ = (duration_ / 1000).toFixed(0);
      93:  const dh = (duration_ / 3600).toFixed(0);
      94:  const dm = ((duration_ % 3600) / 60).toFixed(0);
      95:  const ds = duration_ % 60; 

      In the line 94 when `(duration % 3600)`{} is more that {}30, then _dm is 1 and the text of time duration is 1m ago instead of for example 31s ago.

      Solution: Instead of `.toFixed(0)` method `Math.floor(...)` should be used (also for dh and ds).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mhqanbari MohammadHossein Qanbari
            mhqanbari MohammadHossein Qanbari
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes