$("#datepicker").datepicker();
我正在使用此功能
及其输入框
<input type="text" id="datepicker" name="fulldate" class="form-control wid-100"> <span id="#dpicker_name"></span>
请帮助我的朋友
答案 0 :(得分:0)
用于此代码
<强>演示强>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
$(document).ready(function(){
$('#datepicker').on('change', function(){
var dateThis = $(this).val();
$('#dpicker_name').text(dateThis);
});
});
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"> <span id="dpicker_name"></span></p>
</body>
</html>
答案 1 :(得分:0)
试试这个。
{{1}}
答案 2 :(得分:0)
获取private boolean doesUserHavePermission()
{
int result = context.checkCallingOrSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
return result == PackageManager.PERMISSION_GRANTED;
}
中的值为
javascript
并将其分配给var date = $(".datepicker").val();
答案 3 :(得分:0)
你必须这样做
$(document).ready(function(){
$("#datepicker").datepicker({
onSelect: function(dateText, inst) {
$("#dpicker_name").html(dateText);
}
});
});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.css">
<input type="text" id="datepicker" name="fulldate" class="form-control wid-100">
<span id="dpicker_name"></span>
&#13;
您也可以在没有onSelect
之类的情况下获得
$("#datepicker").datepicker("getDate");
答案 4 :(得分:0)
试试这个
$( "#datepicker" ).datepicker({
showOn: "button",
buttonImage: "images/calendar.gif",
buttonImageOnly: true,
buttonText: "Select date"
});
在我看来,你想点击图标来触发日期选择器。 Check the docs here