2015-04-06 106 views
0

我正在使用輸入類型「日期」標籤,我期望它能驗證日期,比如四月不能有31天等等。但是,這種驗證在我第一次設置「31-04-2014」時不起作用,如果我再次進入日期字段並將日期更改爲其他內容並回到無效日期,則會引發錯誤。AngularJS日期驗證不僅僅是第一次工作

<input type="date" class="form-control" ng-model="someModel" name="abc" ng-required="de.compulsory" /> 

<span class="errortxt" ng-show="form.eventDataEntryForm.abc.$error.date"> ERROR</span> 
+0

while it's first first time you should use'new Date(「31-04-2014」)' – 2015-04-06 05:28:53

回答

相關問題