2015-04-06 53 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

回答

相关问题