Is this possible to have one DateTime property in model, but use it as two inputs on view/form? For example Date part will be using jqueryui datepicker, while Time part picker will be a masked input, or other nifty jquery plugin. From time to time i need to use two dropdows for time picking (hours and minutes).
My goal is to have one DateTime property in model (no partial strings for date and time). Is this possible? Using MVC4.
Here’s a technique i use to split a date into 3 fields, while only having 1 DateTime property on the ViewModel. While not exactly what you’re after, you should be able to use a similar method to achieve what you want.
Editor Template
/views/shares/editortempaltes/datetime.cshtml
Custom ModelBinder
Usage
Add a DateTime property to your ViewModel, then call