From 17c88454493bf4e79b37d693649306127ce90040 Mon Sep 17 00:00:00 2001 From: sipp11 Date: Mon, 13 Oct 2014 10:05:29 +0700 Subject: [PATCH] Filter today by default This app is always daily information anyway, any info other than today is not useful so far. --- js/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index e6c5402..1f087c9 100755 --- a/js/app.js +++ b/js/app.js @@ -25,6 +25,7 @@ var showtimes = [ ]; var restUrl = 'http://localhost:8888'; +var today = new Date(); App.Router.map(function() { @@ -52,7 +53,11 @@ App.TheatersRoute = Ember.Route.extend({ App.ShowtimesRoute = Ember.Route.extend({ model: function(params) { var theatersObjs = this.modelFor('theaters'); - return $.getJSON(restUrl+'/showtimes/'+theatersObjs[0].group+'/'+params.code+'/'); + var url = [ + restUrl, '/showtimes/', theatersObjs[0].group, + '/', params.code, '/?d=', moment(today).format('YYYY-MM-DD') + ]; + return $.getJSON(url.join('')); } });