"MVC5" Date selection control DatePicker

Source: Internet
Author: User

The bootstrap is used in the project, and the date control selects the DatePicker that relies on bootstrap.

  1. Referencing CSS and JS files in App_start\bundleconfig.cs;
    Bundles. ADD (NewScriptbundle ("~/bundles/bootstrap"). Include ("~/scripts/bootstrap.js",                      "~/scripts/respond.js",                      "~/scripts/bootstrap-datepicker.js",                      "~/scripts/bootstrap-datepicker.zh-cn.min.js")); Bundles. ADD (NewStylebundle ("~/content/css"). Include ("~/content/bootstrap.min.css",                      "~/content/bootstrap-theme.min.css",                      "~/content/site.css",                      "~/content/bootstrap-datepicker.min.css"));
  2. The page is loaded after the initialization of the control (specific parameters to access the sample page to view);
    @section scripts{<script>        $(function () {            //Date Control Settings$ ('. DatePicker ')). DatePicker ({format:"Yyyy/mm/dd", Language:"ZH-CN", Weekstart:0, todaybtn:"Linked", clearbtn:true, Keyboardnavigation:true, Todayhighlight:true, AutoClose:true            });    }); </script>}
  3. Effect

: Https://github.com/eternicode/bootstrap-datepicker

Sample:http://eternicode.github.io/bootstrap-datepicker/?markup=input&format=&weekstart=&startdate =&enddate=&startview=0&minviewmode=0&todaybtn=false&clearbtn=false&language=en& Orientation=auto&multidate=&multidateseparator=&keyboardnavigation=on&forceparse=on#sandbox

"MVC5" Date selection control DatePicker

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.