Last active
August 29, 2015 14:04
-
-
Save webspace-jp/2b63a87ad4b6c7ea252a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Insert title here</title> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> | |
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/themes/smoothness/jquery-ui.css"> | |
<body> | |
<div class="container"> | |
<form role="form"> | |
<div class="form-group"> | |
<div class="input-group"> | |
<input type="text" id="datepicker" class="form-control" value=""> | |
<span class="input-group-btn"> | |
<button class="btn btn-default" type="button" data-toggle="datepicker" data-target="#datepicker"> | |
<span class="glyphicon glyphicon-calendar"></span></button> | |
</span> | |
</div> | |
</div> | |
</form> | |
</div> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/i18n/jquery-ui-i18n.min.js"></script> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<script> | |
$(function(){ | |
$.datepicker.setDefaults( $.datepicker.regional[ "ja" ] ); | |
$('[data-toggle=datepicker]').each(function () { | |
var target = $(this).data('target') || ''; | |
if (target) { | |
$(target).datepicker(); | |
$(this).bind("click", function () { | |
$(target).datepicker("show"); | |
}); | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment