Skip to content

Instantly share code, notes, and snippets.

@vbjay
Created June 1, 2015 15:13
Show Gist options
  • Save vbjay/871c5337478eb186ce39 to your computer and use it in GitHub Desktop.
Save vbjay/871c5337478eb186ce39 to your computer and use it in GitHub Desktop.
mvc 5 Date EditorTemplate View
Modeltype Date?
@code Dim dt As Date = Now
If Model.HasValue Then dt = Model
@Html.TextBox("", String.Format("{0:d}", dt.ToShortDateString()), New With {.Value = dt.ToString("yyyy-MM-dd"), .class = "form-control datecontrol datepicker", .Type = "date"})
End code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment