You can achieve this by creating a custom EditorTemplate and tell MVC to use it with [UIHint]
.
ViewModel:
[Display(Name = "Date Start")]
[UIHint("DateTimePicker")]
public DateTime EventStart { get; set; }
Views/Shared/EditorTemplates/DateTimePicker.cshtml:
@model DateTime
<input type="text" name="@Html.NameFor(m => m)" id="@Html.IdFor(m => m)" value="@Model.ToString("o")"/>
<script type="text/javascript">
// init the datepicker of your JS UI Framework (I am using jQuery UI here)
$('#@Html.IdFor(m => m)').datepicker();
</script>
Usage in Main View:
@Html.EditorFor(m => m.EventStart)
The problem with this approach is that you loose the handle on the JS datepicker object created in the EditorTemplate. So if you want to change the configuration (e.g. set the maxDate dynamically), you have to build additional infrastructure.
So my recommendation is to attach the JS datepicker directly in the view that needs it and configure it there instead of using Editor Templates for datepickers.