タグ

jqueryとmvcに関するkiyo_hikoのブックマーク (2)

  • 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で問題なさすぎてビビった。がうがう。
  • ASP.NET MVC5でDatepicker for Bootstrapを使う - なか日記

    日付を選択させる際、今までjQueryUIのDatepickerを使っていましたが何気にNuGetで検索してるとDatepicker for Bootstrapというのを見つけたので使ってみました。 1.パッケージをインストール GitHub*1からダウンロードして手動で組み込んでもいいのですが、せっかくなのでNuGet使いましょう。 パッケージマネージャのコンソールで以下のコマンドを叩きます。 > Install-Package Bootstrap.Datepicker NuGetを使うと依存関係とか解決してくれるので楽ちんですね。 2.jsを読み込むよう設定 体のbootstrap-datepicker.jsを読み込むようにします。 BundleConfig.csを以下の様に変更します*2 bundles.Add(new ScriptBundle("~/bundles/bootstr

    ASP.NET MVC5でDatepicker for Bootstrapを使う - なか日記
    kiyo_hiko
    kiyo_hiko 2015/08/10
    手順が順序どおりまとまっていて迷わなかった
  • 1