我在 UI 中有以下字段
- 约会日期
04/13/2013 - 开始时间
13:00 - 时间结束
14:30
当前的数据库设计是
- 约会日期
SMALLDATETIMEEx 值04-13-2013 - 开始时间
SMALLDATETIMEEx 值04-13-2013 13:00 - EndTime
SMALLDATETIMEEx 值04-13-2013 14:30
我为这个模型设计了一个类
public class Appointment
{
DateTime? AppointmentDate{get;set;}
DateTime? StartTime{get;set;}
DateTime? EndTime{get;set;}
}
我使用 ASP.Net MVC 4 和
@Html.TextBox("", m.StartTime.ToString("HH:mm"))
添加了 jQuery 验证插件,我得到验证消息14:30不是有效日期。
我可以在UI/DataBase/Validation中实现哪些更改来处理时间输入?
我正在使用 SQL Server 2008