【发布时间】:2018-10-29 14:27:02
【问题描述】:
我想设置活动日期的背景颜色。默认值为蓝色,我想将其设置为绿色。知道如何实现吗?
我使用下面的日期选择器:
这是我的代码:
html:
<ng-datepicker [options]=option [(ngModel)]="date"></ng-datepicker>
ts:
this.option = {
minYear: 1970,
maxYear: 2050,
displayFormat: 'MM.DD.YYYY',
barTitleFormat: 'MMMM YYYY',
dayNamesFormat: 'dd',
firstCalendarDay: 1, // 0 - Sunday, 1 - Monday
locale: deLocale,
//minDate: new Date(Date.now()), // Minimal selectable date
//maxDate: new Date(Date.now()), // Maximal selectable date
barTitleIfEmpty: 'Wähle ein Datum aus',
placeholder: 'Wähle ein Datum aus', // HTML input placeholder attribute (default: '')
addStyle: {
}, // Optional, value to pass to [ngStyle] on the input field
fieldId: 'my-date-picker', // ID to assign to the input field. Defaults to datepicker-<counter>
useEmptyBarTitle: false, // Defaults to true. If set to false then barTitleIfEmpty will be disregarded and a date will always be shown
};
【问题讨论】:
-
在问题中添加相关代码sn-p。这太笼统和不清楚了。我的意思是我们看不到你的代码,没有它我们怎么知道哪里出了问题?
标签: css angular datepicker