File
|
format
|
Type : string
|
Default value : 'dd.MM.yyyy HH:mm'
|
|
|
|
rxap-date-cell
|
Type : Date | number | string | null
|
Default value : null
|
|
|
import {
ChangeDetectionStrategy,
Component,
Input,
} from '@angular/core';
import {
DatePipe,
NgIf,
} from '@angular/common';
@Component({
// eslint-disable-next-line @angular-eslint/component-selector
selector: 'td[rxap-date-cell]',
templateUrl: './date-cell.component.html',
styleUrls: ['./date-cell.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [NgIf, DatePipe]
})
export class DateCellComponent {
@Input('rxap-date-cell')
public date: Date | number | string | null = null;
@Input()
public format = 'dd.MM.yyyy HH:mm';
}
<ng-template [ngIf]="date">
{{date | date:format}}
</ng-template>
<ng-content></ng-content>
Legend
Html element with directive