タグ

jqueryとmodelに関するkiyo_hikoのブックマーク (1)

  • MVC DateTime Textbox Formatting Issue

    I would like to do something like model.PickupDate.ToString("d") But MVC4 is not liking that very much. PickupDate is a DateTime field and I would like to strip off the time portion when displayed in the view, while keeping the new { id = "date1" } code which binds the TextBoxFor to the javasript datepicker. How can I display the Date portion only in this instance? @Html.TextBoxFor(model => model.

    MVC DateTime Textbox Formatting Issue
    kiyo_hiko
    kiyo_hiko 2015/08/10
    @Html.EditorFor(model => model.Date, "{0:yyyy-M-d}", htmlAttributes:: new { @class = "date-pickpiku", @readonly = true }) TextBoxForつかえ、って説明見たけど別にEditorForで問題なさすぎてビビった。がうがう。
  • 1