Skip to content

Commit

Permalink
fix: use this.attrs instead of this.getAttr where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiocro committed Aug 31, 2015
1 parent 42b01d9 commit e8600d8
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions addon/components/bs-datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,27 @@ var bsDateTimePickerComponent = Ember.Component.extend({
this.set('bsDateTimePicker', bsDateTimePickerFn);

bsDateTimePicker.on('dp.change', function(ev) {
if(this.get('updateDate')) {
if (Ember.isNone(ev.date) || ev.date === false) {
this.getAttr('updateDate')(undefined);
} else if (!ev.date.isSame(this.getAttr('date'))) {
if (this.getAttr('forceDateOutput')) {
this.getAttr('updateDate')(ev.date.toDate());
} else {
this.getAttr('updateDate')(ev.date);
Ember.run( function(){
if(this.get('updateDate')) {
if (Ember.isNone(ev.date) || ev.date === false) {
this.attrs.updateDate(undefined);
} else if (!ev.date.isSame(this.getAttr('date'))) {
if (this.attrs.forceDateOutput) {
this.attrs.updateDate(ev.date.toDate());
} else {
this.attrs.updateDate(ev.date);
}
}
}
}
else {
//warn
}
else {
//warn
}
}.bind(this));
}.bind(this));

this._updateDateTimePicker();

if (this.getAttr('open')) {
if (this.attrs.open) {
this.get('bsDateTimePicker').show();
}
}),
Expand Down

0 comments on commit e8600d8

Please sign in to comment.