Browse Source

Ensure time to int returns an integer

Chocobozzz 1 month ago
parent
commit
ca889dbbb8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/core-utils/src/common/date.ts

+ 1 - 1
packages/core-utils/src/common/date.ts

@@ -49,7 +49,7 @@ export const timecodeRegexString = `(\\d+[h:])?(\\d+[m:])?\\d+s?`
 
 function timeToInt (time: number | string) {
   if (!time) return 0
-  if (typeof time === 'number') return time
+  if (typeof time === 'number') return Math.floor(time)
 
   // Try with 00h00m00s format first
   const reg = new RegExp(`^((?<hours>\\d+)h)?((?<minutes>\\d+)m)?((?<seconds>\\d+)s?)?$`)