我对dx-calendar
来自devExtreme
. 我试图将一周的第一天设置为 1 以将星期一设置为一周的第一天。组件的日期工作正常。但问题出在标题中。我正在使用 Angular 7 和 devExtreme 18。
在此处参考此图片:(https://drive.google.com/open?id=11g3igXM1lNfC03xsGeAN173uDlkXgBNH)
<dx-calendar
firstDayOfWeek="1"
(onInitialized)="onInitialized()"
(onValueChanged)="onValueChanged($event)"
cellTemplate="custom"
>
<span
*dxTemplate="let cell of 'custom'"
[ngClass]="getCellCssClass(cell.date)">
{{ cell.text }}
</span>
</dx-calendar>
...
onInitialized() {
const today = new Date();
setTimeout(() => {
$('.dx-calendar-caption-button span.dx-button-text').html(this.getFormatedDateString(today));
}, 100);
}
...
getCellCssClass(date: string) {
let cssClass = 'date ';
const today = new Date();
const d = new Date(date);
const matchCase = this.specialDates.find((item) => {
return item.date.toUTCString().substr(0, 16) === d.toUTCString().substr(0, 16);
});
if (matchCase === undefined) {
if (today.toUTCString().substr(0, 16) === d.toUTCString().substr(0, 16)) {
cssClass += 'today';
}
} else {
cssClass += 'type' + matchCase.type;
}
return cssClass;
}
...