The bootstrap is used in the project, and the date control selects the DatePicker that relies on bootstrap.
- 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"));
- 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>}
- 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