Last active
February 15, 2017 21:51
-
-
Save grapho/2a0954a024b1f4f39077e940846f109a to your computer and use it in GitHub Desktop.
Timepicker
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInsertElement() { | |
this._super(...arguments); | |
this.$('input').timepicker({ | |
timeFormat: 'h:mm:ss p', | |
change(datetime) { | |
let time = datetime.toTimeString() | |
console.log(time.slice(0, time.indexOf(' '))); | |
} | |
}); | |
} | |
}); |
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
import Ember from 'ember'; | |
import moment from 'moment'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
date: '2010-12-11', | |
time: '03:00', | |
momentCalculated: Ember.computed('date', 'time', function() { | |
let date = this.get('date'); | |
let time = this.get('time'); | |
return moment(`${date}T${time}`); | |
}) | |
}); |
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
{ | |
"version": "0.10.5", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.6.0", | |
"ember-data": "2.6.0", | |
"ember-template-compiler": "2.6.0", | |
"ember-testing": "2.6.0", | |
"jquery-timepicker": "https://cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js" | |
}, | |
"addons": { | |
"ember-moment": "4.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment