Skip to content

Commit 7fd8a5a

Browse files
author
Guillaume Chau
committed
fix: pad milliseconds, closes #1109
1 parent f827eca commit 7fd8a5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/app-frontend/src/filters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const specialTypeRE = /^\[native (\w+) (.*)\]$/
1313

1414
export function formatTime (timestamp, format) {
1515
const date = new Date(timestamp)
16-
return `${date.toString().match(/\d\d:\d\d:\d\d/)[0]}${format === 'ms' ? '.' + date.getMilliseconds() : ''}`
16+
return `${date.toString().match(/\d\d:\d\d:\d\d/)[0]}${format === 'ms' ? '.' + String(date.getMilliseconds()).padStart(3, '0') : ''}`
1717
}
1818

1919
export function valueType (value) {

0 commit comments

Comments
 (0)