Created
February 13, 2014 21:04
-
-
Save endash/8983793 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 () {}); | |
}) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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