Created
June 1, 2015 15:13
-
-
Save vbjay/871c5337478eb186ce39 to your computer and use it in GitHub Desktop.
mvc 5 Date EditorTemplate View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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