2016-10-07 6 views
0

내가 날짜 Angular2와 마스킹 및 타이프 라이터의 입력 날짜 wijmo 사용하고 = 값 경우 작동하지Wijmo WJ-입력 날짜는 널 (null)

<wj-input-date [value]="_note.StartDate" [format]="'d'" [mask]="'99/99/9999'" class="ibox1 rightalign"></wj-input-date> 
I는 다음과 같이 사용할 때이 일하고

,

constructor(... 
{ 
    if (this._note.StartDate != null) { this._note.StartDate = new Date(this._note.StartDate.toString()); } 
    else { this._note.StartDate = new Date(); } 
} 
값이이

constructor(... 
{ 
    if (this._note.StartDate != null) { this._note.StartDate = new Date(this._note.StartDate.toString()); } 
} 

처럼, 널 (null)이지만, 그것은 예외를주고 만약 내가 아무것도하지 않을

하지만, "어설 Wijmo 실패 : 날짜 애 썼는데 이라고 말했다.

답변

1

[필수] = "거짓"을 사용하고 [마스크] = " '99/99/9999'"를 제거하십시오. _note.StartDate는 날짜 유형이어야합니다.

<wj-input-date [(value)]="_note.StartDate" [format]="'d'" class="ibox1 rightalign" [required]="false"></wj-input-date> 
+0

wijmo의 최신 버전이 변경되었습니다. [isRequired] = "false"여야합니다. –