Created
August 16, 2016 15:18
-
-
Save Panman82/3ce7c3d5f9d88a331f0c7373f82a0ad2 to your computer and use it in GitHub Desktop.
Semantic UI Ember Calendar Component
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
// app/components/ui-calendar.js | |
import Ember from 'ember'; | |
import UiBase from 'semantic-ui-ember/mixins/base'; | |
export default Ember.Component.extend( UiBase, { | |
module: 'calendar', | |
classNames: ['ui', 'calendar'], | |
icon: 'calendar', | |
placeholder: 'Date', | |
getSemanticIgnorableAttrs() { | |
return ['date','icon','placeholder']; | |
}, | |
willInitSemantic( settings ) { | |
settings.type = 'date'; | |
this._super( ...arguments ); | |
}, | |
didInitSemantic() { | |
this._super( ...arguments ); | |
let date = this.get('date'); | |
if ( date ) { | |
this.$().calendar('set date', date); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment