[(ngModel)] keeps track of a variable that can be set by yourself inside your controller. displayFormat is a comman formatting schema for your date. If you want to display for example in German format, then you will have to write DD.MM.YYYY .
For styling modifications check:
https://ionicframework.com/docs/api/components/datetime/DateTime/#sass-variables. There are five ariables for each device type (iOS, Android and deprecated Windows Phone):
$datetime-ios-padding-top
$datetime-ios-padding-end
$datetime-ios-padding-bottom
$datetime-ios-padding-start
$datetime-ios-placeholder-color
For a working example look at the GitHub Page of Ionic:
2条答案
按热度按时间bnlyeluc1#
First, please have a look at the documentation:
https://ionicframework.com/docs/api/components/datetime/DateTime/
Ionic DateTime components are looking like this one:
[(ngModel)]
keeps track of a variable that can be set by yourself inside your controller.displayFormat
is a comman formatting schema for your date. If you want to display for example in German format, then you will have to writeDD.MM.YYYY
.For styling modifications check:
https://ionicframework.com/docs/api/components/datetime/DateTime/#sass-variables. There are five ariables for each device type (iOS, Android and deprecated Windows Phone):
$datetime-ios-padding-top
$datetime-ios-padding-end
$datetime-ios-padding-bottom
$datetime-ios-padding-start
$datetime-ios-placeholder-color
For a working example look at the GitHub Page of Ionic:
https://github.com/ionic-team/ionic-docs/blob/master/src/demos/api/datetime/index.html
c8ib6hqw2#
我知道这是一个老问题,但如果有人仍然需要一个方法来定制组件的外观,这里是我的方法。
我使用Angular的Renderer2将一个部件属性应用到(在我的例子中)日历日,这样我就可以根据需要设置它们的样式。
然后我用常规的scss来格式化。