Created
October 1, 2011 12:32
-
-
Save ef4/1256004 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.AgendaController = SC.Object.extend | |
month: (-> | |
if m = /agenda\/(\d+)/.exec(@get('subpath')) | |
Number(m[1]) | |
else | |
(new Date).getMonth() + 1 | |
).property('subpath').cacheable() | |
year: (-> | |
if m = /agenda\/\d+\/(\d+)/.exec(@get('subpath')) | |
Number(m[1]) | |
else | |
(new Date).getFullYear() | |
).property('subpath').cacheable() | |
firstDate: (-> | |
new Date(@get('year'), @get('month') - 1, 1) | |
).property('month', 'year').cacheable() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment