From e69b9acd4978bccd79979678861da7b9172ad72d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 17 Jul 2016 15:26:49 +0200 Subject: use DateTime in model diff --git a/www/js/jingles.js b/www/js/jingles.js index 6f0d10c..dc27c6e 100644 --- a/www/js/jingles.js +++ b/www/js/jingles.js @@ -254,7 +254,7 @@ Rdxport.JingleCutView.prototype.render = function() { .append($('').text(this.model.name)) .append($('').text(this.model.description)) .append($('').text(msToTimeString(this.model.length))) - .append($('').text(format_datetime(new Date(this.model.originDatetime)))) + .append($('').text(format_datetime(this.model.originDatetime))) .append( $('').addClass('text-center') .append(moveButton) diff --git a/www/js/musicpools.js b/www/js/musicpools.js index e110818..ad1a532 100644 --- a/www/js/musicpools.js +++ b/www/js/musicpools.js @@ -263,12 +263,12 @@ Rdxport.MusicpoolCartView.prototype.render = function() { var cut = this.model.cuts[0]; length = msToTimeString(Number(cut.length)); - if (!isNaN(new Date(cut.originDatetime))) { - imported = format_datetime(new Date(cut.originDatetime)); + if (!isNaN(cut.originDatetime)) { + imported = format_datetime(cut.originDatetime); } playcnt = cut.playCounter; if (!isNaN(cut.lastPlayDatetime)) { - lastplayed = format_datetime(); + lastplayed = format_datetime(cut.lastPlayDatetime); } } diff --git a/www/js/rdxport.js b/www/js/rdxport.js index ceef6be..44198ed 100644 --- a/www/js/rdxport.js +++ b/www/js/rdxport.js @@ -514,7 +514,7 @@ Rdxport.Cut = function(name, description, cart, length, originDatetime, this.name = $('cutName', this.xml).text(); this.description = $('description', this.xml).text(); this.length = $('length', this.xml).text(); - this.originDatetime = $('originDatetime', this.xml).text(); + this.originDatetime = new Date($('originDatetime', this.xml).text()); this.playCounter = $('playCounter', this.xml).text(); this.lastPlayDatetime = new Date(new Date($('lastPlayDatetime', this.xml).text()) - 5000); // playout-server live 5s in the future this.cart = arguments[1]; @@ -523,7 +523,7 @@ Rdxport.Cut = function(name, description, cart, length, originDatetime, this.description = description; this.cart = cart; this.length = length; - this.originDatetime = originDatetime; + this.originDatetime = new Date(originDatetime); this.playCounter = playCounter; this.lastPlayDatetime = new Date(new Date(lastPlayDatetime) - 5000); // playout-server live 5s in the future } diff --git a/www/js/shows.js b/www/js/shows.js index cf18531..9cbc72e 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -346,7 +346,7 @@ Rdxport.ShowCartView.prototype.render = function() { var lastPlayDatetime = '-'; if (cut) { length = msToTimeString(Number(cut.length)); - originDatetime = format_datetime(new Date(cut.originDatetime)); + originDatetime = format_datetime(cut.originDatetime); playCounter = cut.playCounter; lastPlayDatetime = format_datetime(cut.lastPlayDatetime); } -- cgit v0.10.2