Revert "fix(datetime): recalculate day column when month or year is changed (#17815)" (#17845)

This reverts commit 9273f97a0cfbb007f20d4977bde3933d6933f9e5.
This commit is contained in:
Liam DeBeasi
2019-03-21 09:06:06 -04:00
committed by GitHub
parent 9273f97a0c
commit e915aeda6b
6 changed files with 1 additions and 302 deletions

View File

@ -261,36 +261,11 @@ export class Datetime implements ComponentInterface {
const pickerOptions = this.generatePickerOptions();
const picker = await this.pickerCtrl.create(pickerOptions);
this.isExpanded = true;
picker.onDidDismiss().then(() => {
this.isExpanded = false;
this.setFocus();
});
picker.addEventListener('ionPickerColChange', async (event: any) => {
const data = event.detail;
/**
* Don't bother checking for non-dates as things like hours or minutes
* are always going to have the same number of column options
*/
if (data.name !== 'month' && data.name !== 'day' && data.name !== 'year') { return; }
const colSelectedIndex = data.selectedIndex;
const colOptions = data.options;
const changeData: any = {};
changeData[data.name] = {
value: colOptions[colSelectedIndex].value
};
this.updateDatetimeValue(changeData);
const columns = this.generateColumns();
picker.columns = columns;
await this.validate(picker);
});
await this.validate(picker);
await picker.present();
}
@ -325,7 +300,6 @@ export class Datetime implements ComponentInterface {
text: this.cancelText,
role: 'cancel',
handler: () => {
this.updateDatetimeValue(this.value);
this.ionCancel.emit();
}
},