DateTimePicker for Bootstrap v3

Source: Internet
Author: User

Recently in the Web front-end, first contact, corporate boss recommended Bootstrap framework, using the V3 version, using his calendar plug-ins

Most of the online is based on the V2 version of DateTimePicker, which is about V3 information


http://www.bootcss.com/p/bootstrap-datetimepicker/


Insert JSP code as follows

	<div class= "Container" >
		<div class= "Row" >
			<div class= ' col-sm-6 ' >
				<div class= ' Input-group date Form_date ">
					<input size=" type= "text" value= "" class= "Form-control" >
					<span class= "Input-group-addon glyphicon Glyphicon-calenda" ><span class= "Glyphicon glyphicon-calendar
						" > </span> </span>
				</div>
			</div>
		</div>
</div>

	< Script type= "Text/javascript" >
		$ (". Form_date"). DateTimePicker ({
			format: "Yyyy-mm-dd",
			Autoclose:true,
			todaybtn:true,
			minview:2, 
			language: "ZH-CN",
			startdate: "2014-08-14",
		} );
	</script>

The exception is then found, as shown in the figure:



Find the following code from Datetimepicker/js/bootstrap-datetimepicker.js, about 62 lines

        This.component = This.element.is ('. Date ')? (This.bootcssver = 3 This.element.find ('. Input-group-addon. glyphicon-th,. Input-group-addon. Glyphicon-time. Input-group-addon. Glyphicon-calendar. Fa-calendar. Fa-clock-o '). Parent (): This.element.find ('. Add-on. icon-th,. Add-on. Icon-time,. Add-on Icon-calendar. Fa-calendar. Fa-clock-o '). Parent (): false;



Found a problem with the object component get, add a separate fetch to. Input-group-addon, modify the code to

        This.component = This.element.is ('. Date ')? (This.bootcssverr = 3 This.element.find ('. Input-group-addon,. Input-group-addon glyphicon-th,. Input-group-addon. Glyphicon-time, Input-group-addon. Glyphicon-calendar fa-calendar. Fa-clock-o '). Parent (): This.element.find ('. Add-on. icon-th, add-on Icon-time,. Add-on. Icon-calendar. Fa-calendar. Fa-clock-o '). Parent (): false;



OK, normal work

has been doing Linux C backstage, now learning the front end, a variety of egg pain


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.