我的应用程序中有一个日期选择器,它会显示iOS原生日期选择器。我想将其更改为显示月视图(随附图片供参考)。我该如何做到这一点?是否有模块可以在我现有的应用中使用?
8oomwypt1#
I found a solution here:https://www.freakyjolly.com/ionic-angular-material-how-to-install-material-and-use-its-components-in-ionic-app/References I used:https://forum.ionicframework.com/t/ionic5-with-angular-material/215303I was having dependency issues installing material, so I added this under dependencies in packages.json:"@angular/animations": "~8.1.3"Then I installed material using this command:ng add @angular/material@8.0.0I also didnt have angular installed so I used this to install angular:npm install -g @angular/cli@8.1.3
"@angular/animations": "~8.1.3"
ng add @angular/material@8.0.0
npm install -g @angular/cli@8.1.3
cx6n0qe32#
例如:<ion-datetime presentation="month-year"></ion-datetime>Stackblitz demo
<ion-datetime presentation="month-year"></ion-datetime>
2条答案
按热度按时间8oomwypt1#
I found a solution here:
https://www.freakyjolly.com/ionic-angular-material-how-to-install-material-and-use-its-components-in-ionic-app/
References I used:
https://forum.ionicframework.com/t/ionic5-with-angular-material/215303
I was having dependency issues installing material, so I added this under dependencies in packages.json:
"@angular/animations": "~8.1.3"
Then I installed material using this command:
ng add @angular/material@8.0.0
I also didnt have angular installed so I used this to install angular:
npm install -g @angular/cli@8.1.3
cx6n0qe32#
例如:
<ion-datetime presentation="month-year"></ion-datetime>
Stackblitz demo