1
0
mirror of https://gitlab.com/Deukhoofd/BattleSim.git synced 2025-10-29 10:40:04 +00:00

Lots of stuff

This commit is contained in:
Deukhoofd
2016-02-01 23:19:30 +01:00
commit d7316d5799
6681 changed files with 527969 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
class @Replay extends Backbone.Model
urlRoot: '/replays'
getFormat: ->
window.Formats[@get('format')].humanName
getCreatedAt: ->
date = new Date(@get('created_at'))
day = date.getDate()
month = date.getMonth() + 1
year = date.getFullYear()
timeOfDay = 'a.m.'
hours = date.getHours()
minutes = "00#{date.getMinutes()}"[-2...]
seconds = "00#{date.getSeconds()}"[-2...]
if hours > 12
hours = hours % 12
timeOfDay = 'p.m.'
"#{year}/#{month}/#{day} #{hours}:#{minutes}:#{seconds} #{timeOfDay}"