Created
August 15, 2016 18:22
-
-
Save jelhan/7ff74a9f6ee7028dbf712b2b02ba06b5 to your computer and use it in GitHub Desktop.
ember-bootstrap-datepicker with momentjs
This file contains 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
import Ember from 'ember'; | |
const { computed } = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
date: computed('model', { | |
get() { | |
return this.get('moment').toDate(); | |
}, | |
set(i, date) { | |
this.set('moment', moment(date)); | |
return date; | |
} | |
}), | |
moment: computed.alias('model') | |
}); |
This file contains 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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model() { | |
return moment('2016-01-01'); | |
} | |
}); |
This file contains 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
{ | |
"version": "0.10.4", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"moment": "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.js", | |
"ember": "2.6.2", | |
"ember-data": "2.7.0", | |
"ember-template-compiler": "2.6.2" | |
}, | |
"addons": { | |
"ember-cli-bootstrap-datepicker": "0.5.5" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment