Skip to content

Commit 3c5f466

Browse files
authored
fix: parse time without fractional seconds (#113)
1 parent 8b0845d commit 3c5f466

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers/formatTM.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function formatTM(time, strFormat = 'HH:mm:ss') {
1515
try {
1616
const inputFormat = 'HHmmss.SSS';
1717
const strTime = time.toString().substring(0, inputFormat.length);
18-
const parsedDateTime = parse(strTime, 'HHmmss.SSS', new Date(0));
18+
const parsedDateTime = parse(strTime, inputFormat.substring(0,strTime.length), new Date(0));
1919
const formattedDateTime = format(parsedDateTime, strFormat);
2020

2121
return formattedDateTime;

0 commit comments

Comments
 (0)