我使用强类型的DateTime?我的ViewModel中的属性在我的项目上,并且使用了有关不显眼验证的自定义验证属性。自定义属性之前,它都工作得很好,但现在我得到“完成日期字段必须是日期”,同时从Safari浏览我的应用程序。这是safari唯一的问题我已经在ie,chrome和ff中测试过我的应用程序,并且没有发现任何问题。特别是在遵循datetime的格式参数之后。面对“野外必须是日期”与safari和IE的问题
@Html.TextBoxFor(m => m.ProjectCompletionDate, "{0:d}",
new { @class = "input-large", size = "16",id="inputDatepicker2" })
我的看法是强类型的..我不知道接下来是什么... plz帮助
OKI这不仅是Safari浏览器,IE浏览器在做同样的... FF和铬工作很好。我实际上使用引导日期选择器扩展。这看起来像......
<div class="date" id="datepicker1" data-date-format="M/d/yyyy">
Html.TextBoxFor(m => m.ProjectCommencementDate,"{0:d}", new { @class = "input-large", size = "16",id="inputDatepicker1" })
<span class="add-on"><i class="icon-th"></i></span>
Html.ValidationMessageFor(m => m.ProjectCommencementDate)
</div>
$('#datepicker1').datepicker({
autoclose:true
}).on('changeDate', function (ev) {
//$('#inputDatepicker2').focus();
});
我碰到这个问题的链接
这是更加惊人..来到仍然希望能得到一些出路。
可以显示试图验证日期的JavaScript部分吗? – insertusernamehere 2013-03-15 08:25:14
@insertusernamehere我更新了我的问题... – afr0 2013-03-15 08:35:40
也许浏览器对大写'M'有问题?手册中说:“*日期格式,d,dd,m,mm,yy,yyy。*的组合。”这只是从[选项](http://www.eyecon.ro/bootstrap-datepicker/) – insertusernamehere 2013-03-15 08:46:18