다음 형식으로 날짜를 표시하려고합니다 : dd/MM/yyyy
, 그러나 이는 MM/dd/yyyy
에만 표시됩니다. 여기각도 2의 ng2-bootstrap에서 날짜 파이프가 제대로 작동하지 않는 이유
은 내 startdateComponent
:
import {Component, EventEmitter, Output, Input} from '@angular/core';
import {DATEPICKER_DIRECTIVES} from 'ng2-bootstrap/components/datepicker';
@Component({
templateUrl:'./app/home/item_component/start_date_component/start_date_component.html',
directives: [DATEPICKER_DIRECTIVES]
})
export class StartDateComponent() {
chosenDate : Date = new Date();
getDate() {
return this.chosenDate;
}
}
템플릿은 다음과 같습니다
<div class="col-sm-1 col-sm-offset-1 datePicked ">
<span>
<h4>{{getDate() | date: 'dd/MM/yyyy'}}</h4>
</span>
</div>
여기에 어떤 문제가 있습니까?
감사합니다! ... yeappp ... – Serhiy