Skip to content

Commit

Permalink
Merge pull request #2 from Gummientchen/fix-wrong-month
Browse files Browse the repository at this point in the history
Fixes incorrect month, and adds leading zeros to the date.
  • Loading branch information
ShaderWave authored Nov 11, 2021
2 parents 8760dc5 + 30aa8aa commit f0981b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@
player.play()
if (SHOW_CLIP_CREATORS.toLowerCase() == "true") {
let date = new Date(clip.created_at)
overlayText.innerText = `Clipped on ${date.getFullYear()}-${date.getMonth()}-${date.getDate()} by ${clip.creator_name}`
let day = ('0' + date.getDate()).slice(-2);
let month = ('0' + (date.getMonth()+1)).slice(-2);
let year = date.getFullYear();
overlayText.innerText = `Clipped on ${year}-${month}-${day} by ${clip.creator_name}`
}
}

Expand Down

0 comments on commit f0981b8

Please sign in to comment.