Angular +Ionic修改日期组件英文按钮
1,引入日期组件:
<ion-list>
<div class="alert-price">
<ion-datetime displayFormat="YYYY-MM-DD" name ="endDate" [(ngModel)] ="endDate" ></ion-datetime>
<ion-label position="floating"></ion-label>
</div>
</ion-list>
2,添加属性 [pickerOptions]
<ion-datetime displayFormat="YYYY-MM-DD" name ="endDate" [(ngModel)] ="endDate" ></ion-datetime>
<ion-label position="floating" [pickerOptions]="toChinese" ></ion-label>
3,ts中添加
public toChinese = {
buttons: [{
text: '取消',
handler: () => console.log('Clicked Save!')
}, {
text: '保存',
handler: () => {
console.log('Clicked Log. Do not Dismiss.');
}
}]
}
4,主要效果