Skip to content

Commit

Permalink
Fix an issue where OSC timestamps were displayed with the wrong numbe…
Browse files Browse the repository at this point in the history
…r of milliseconds

Signed-off-by: Axel Boberg <[email protected]>
  • Loading branch information
axelboberg committed Feb 21, 2024
1 parent 6a867e1 commit 73ea2c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/osc/app/components/LogItem/index.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react'
import './style.css'

function zeroPad (n) {
if (n < 10) {
function zeroPad (n, magnitude = 10) {
if (n < magnitude) {
return `0${n}`
}
return `${n}`
}

function formatTime (ms) {
const d = new Date(ms)
return `${zeroPad(d.getHours())}:${zeroPad(d.getMinutes())}:${zeroPad(d.getSeconds())}.${d.getMilliseconds()}`
return `${zeroPad(d.getHours())}:${zeroPad(d.getMinutes())}:${zeroPad(d.getSeconds())}.${zeroPad(zeroPad(d.getMilliseconds()), 100)}`
}

export const LogItem = ({ item = {} }) => {
Expand Down

0 comments on commit 73ea2c9

Please sign in to comment.