Skip to content

Commit

Permalink
fix publish date parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer committed Oct 30, 2024
1 parent 43aeeef commit a504d72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,14 @@ export function formatDurationAsTimestamp(lengthSeconds) {

export function timestampToDuration(timestamp) {
const splitTimestamp = timestamp.split(':')
let seconds = timestamp.at(-1)
let seconds = Number(splitTimestamp.at(-1))

if (splitTimestamp.length > 1) {
seconds += timestamp.at(-2) * 60
seconds += Number(splitTimestamp.at(-2) * 60)
}

if (splitTimestamp.length > 2) {
seconds += timestamp.at(-3) * 3600
seconds += Number(splitTimestamp.at(-3) * 3600)
}

return seconds
Expand Down

0 comments on commit a504d72

Please sign in to comment.