How to use the ng-zorro-antd/core.valueFunctionProp function in ng-zorro-antd

To help you get started, we’ve selected a few ng-zorro-antd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NG-ZORRO / ng-zorro-antd / components / calendar / date-table.component.ts View on Github external
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)) {
github NG-ZORRO / ng-zorro-antd / components / calendar / date-table.component.ts View on Github external
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
github NG-ZORRO / ng-zorro-antd / components / date-picker / header-picker.component.ts View on Github external
ngOnChanges(changes: SimpleChanges): void {
    super.ngOnChanges(changes);

    if (changes.nzRenderExtraFooter) {
      this.extraFooter = valueFunctionProp(this.nzRenderExtraFooter);
    }
  }
github NG-ZORRO / ng-zorro-antd / components / date-picker / date-range-picker.component.ts View on Github external
ngOnChanges(changes: SimpleChanges): void {
    super.ngOnChanges(changes);

    if (changes.nzRenderExtraFooter) {
      this.extraFooter = valueFunctionProp(this.nzRenderExtraFooter);
    }

    if (changes.nzShowTime || changes.nzStyle) {
      this.setFixedPickerStyle();
    }
  }