Answer the question
In order to leave comments, you need to log in
How to display full date using Angular?
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html';
})
export class AppComponent {
birthDay : Data = new Data();
}
<div style="text-align:center">
<h1>
{{birthDay | data : dd-MM-yyyy}}
</h1>
</div>
Answer the question
In order to leave comments, you need to log in
birthDay property declaration, type and value - should be Date instead of Data. And when using the pipe, it is similar - it should be date instead of data. And the date format is the same string, where are the quotes? We fix:
birthDay: Date = new Date();
{{ birthDay | date : 'dd-MM-yyyy' }}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question