Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for (let day = 0; day < 7; day++) {
const date = weekStart.addDays(day);
const dateFormat = this.dateHelper.relyOnDatePipe
? 'longDate'
: this.i18n.getLocaleData('DatePicker.lang.dateFormat', 'YYYY-MM-DD');
const title = this.dateHelper.format(date.nativeDate, dateFormat);
const label = this.dateHelper.format(date.nativeDate, this.dateHelper.relyOnDatePipe ? 'dd' : 'DD');
const cell: DateCell = {
value: date.nativeDate,
label: label,
isSelected: false,
isDisabled: false,
isToday: false,
title: title,
dateCellRender: valueFunctionProp(this.dateCellRender, date), // Customized content
dateFullCellRender: valueFunctionProp(this.dateFullCellRender, date),
content: `${date.getDate()}`,
onClick: () => this.changeValueFromInside(date),
onMouseEnter: () => this.dayHover.emit(date)
};
if (this.showWeek && !row.weekNum) {
row.weekNum = this.dateHelper.getISOWeek(date.nativeDate);
}
if (date.isToday()) {
cell.isToday = true;
row.isCurrent = true;
}
if (Array.isArray(this.selectedValue) && date.isSameMonth(this.activeDate)) {
const date = weekStart.addDays(day);
const dateFormat = this.dateHelper.relyOnDatePipe
? 'longDate'
: this.i18n.getLocaleData('DatePicker.lang.dateFormat', 'YYYY-MM-DD');
const title = this.dateHelper.format(date.nativeDate, dateFormat);
const label = this.dateHelper.format(date.nativeDate, this.dateHelper.relyOnDatePipe ? 'dd' : 'DD');
const cell: DateCell = {
value: date.nativeDate,
label: label,
isSelected: false,
isDisabled: false,
isToday: false,
title: title,
dateCellRender: valueFunctionProp(this.dateCellRender, date), // Customized content
dateFullCellRender: valueFunctionProp(this.dateFullCellRender, date),
content: `${date.getDate()}`,
onClick: () => this.changeValueFromInside(date),
onMouseEnter: () => this.dayHover.emit(date)
};
if (this.showWeek && !row.weekNum) {
row.weekNum = this.dateHelper.getISOWeek(date.nativeDate);
}
if (date.isToday()) {
cell.isToday = true;
row.isCurrent = true;
}
if (Array.isArray(this.selectedValue) && date.isSameMonth(this.activeDate)) {
// Range selections
ngOnChanges(changes: SimpleChanges): void {
super.ngOnChanges(changes);
if (changes.nzRenderExtraFooter) {
this.extraFooter = valueFunctionProp(this.nzRenderExtraFooter);
}
}
ngOnChanges(changes: SimpleChanges): void {
super.ngOnChanges(changes);
if (changes.nzRenderExtraFooter) {
this.extraFooter = valueFunctionProp(this.nzRenderExtraFooter);
}
if (changes.nzShowTime || changes.nzStyle) {
this.setFixedPickerStyle();
}
}