diff --git a/server/pages/archive.html b/server/pages/archive.html index 0cc3220..8a0c0a4 100644 --- a/server/pages/archive.html +++ b/server/pages/archive.html @@ -15,14 +15,49 @@ @@ -47,6 +82,9 @@ $(function() { id="ongoing-recs-table" style="margin-top: 3em;"> + Nome + Inizio + Durata Filename diff --git a/server/static/js/new.js b/server/static/js/new.js index 8adc37b..7874092 100644 --- a/server/static/js/new.js +++ b/server/static/js/new.js @@ -102,10 +102,10 @@ $.widget("ror.ongoingrec", { var rec = this.options.rec; this.element.find('input').val(rec.name); this.element.find(':ror-countclock').countclock("option", "since", - rec.starttime !== null ? new Date(rec.starttime*1000) : null); + rec.starttime !== null ? config.date_read(rec.starttime) : null); if(this.options.state > 0) { this.element.find(':ror-countclock').countclock("option", "to", - rec.endtime !== null ? new Date(rec.endtime*1000) : null + rec.endtime !== null ? config.date_read(rec.endtime) : null ); } else { this.element.find(':ror-countclock').countclock("option", "to", null); diff --git a/server/static/js/rec.js b/server/static/js/rec.js index c698591..971dd61 100644 --- a/server/static/js/rec.js +++ b/server/static/js/rec.js @@ -4,6 +4,9 @@ var config = { date_write: function(d) { return Math.floor(d.getTime() / 1000); }, + date_read: function(unix_timestamp) { + return new Date(unix_timestamp * 1000); + }, datetimeformat: function(d) { if(Math.abs(new Date() - d) > (3*60*60*1000)) { return d.toLocaleString(); diff --git a/server/techrec.py b/server/techrec.py index 7950090..e5c2ffd 100644 --- a/server/techrec.py +++ b/server/techrec.py @@ -145,6 +145,7 @@ class RecDB: def get_archive_recent(self): query = self._query_saved() query = self._query_newer(timedelta(days=15), query) + query = query.order_by(Rec.starttime.desc()) return query.all() def _query_ongoing(self, query=None):