mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:51:14 +08:00
FIX: Bugs with year selector and erase button (#17749)
This commit is contained in:
@ -401,22 +401,22 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
_setPickerMinDate(date) {
|
||||
if (date && !moment(date, this.dateFormat).isValid()) {
|
||||
date = null;
|
||||
}
|
||||
|
||||
schedule("afterRender", () => {
|
||||
this._picker.setMinDate(moment(date, this.dateFormat).toDate());
|
||||
if (moment(date, this.dateFormat).isValid()) {
|
||||
this._picker.setMinDate(moment(date, this.dateFormat).toDate());
|
||||
} else {
|
||||
this._picker.setMinDate(null);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_setPickerDate(date) {
|
||||
if (date && !moment(date, this.dateFormat).isValid()) {
|
||||
date = null;
|
||||
}
|
||||
|
||||
schedule("afterRender", () => {
|
||||
this._picker.setDate(moment.utc(date), true);
|
||||
if (moment(date, this.dateFormat).isValid()) {
|
||||
this._picker.setDate(moment.utc(date), true);
|
||||
} else {
|
||||
this._picker.setDate(null);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
@translatedLabel={{this.formattedTo}}
|
||||
@class="date-time" />
|
||||
{{#if this.toFilled}}
|
||||
<DButton @icon="times" action={{action "eraseToDateTime"}} @class="delete-to-date" />
|
||||
<DButton @icon="times" @action={{action "eraseToDateTime"}} @class="delete-to-date" />
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user