Skip to content

Instantly share code, notes, and snippets.

@endash
Created February 13, 2014 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endash/8983793 to your computer and use it in GitHub Desktop.
Save endash/8983793 to your computer and use it in GitHub Desktop.
App.Router.map(function() {
this.route('sign_in');
this.resource("calendar", function () {
this.resource("calendar_month", {path: 'month'}, function () {});
this.resource("calendar_week", {path: 'week'}, function () {});
this.resource("calendar_day", {path: 'day'}, function () {});
})
});
App.CalendarController = Ember.Controller.extend({
queryParams: ['date'],
date: null,
_date: Ember.computed('date', function () {
return moment(this.get('date') || undefined);
}),
adjustDateBy: function (interval) {
this.set('date', this.get('_date').add(interval).format('YYYY-MM-DD'));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment