Browse Source

Filter today by default

This app is always daily information anyway, any info other than
today is not useful so far.
master
sipp11 10 years ago
parent
commit
17c8845449
  1. 7
      js/app.js

7
js/app.js

@ -25,6 +25,7 @@ var showtimes = [
]; ];
var restUrl = 'http://localhost:8888'; var restUrl = 'http://localhost:8888';
var today = new Date();
App.Router.map(function() { App.Router.map(function() {
@ -52,7 +53,11 @@ App.TheatersRoute = Ember.Route.extend({
App.ShowtimesRoute = Ember.Route.extend({ App.ShowtimesRoute = Ember.Route.extend({
model: function(params) { model: function(params) {
var theatersObjs = this.modelFor('theaters'); 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(''));
} }
}); });

Loading…
Cancel
Save