【发布时间】:2014-04-07 12:27:08
【问题描述】:
在过去,我构建的系统使用 jQuery 日期选择器并且效果很好。最近我决定转而使用 twitter bootstrap 进行设计,并很快发现它不喜欢 jQuery UI。
我正在尝试让http://www.eyecon.ro/bootstrap-datepicker/ 工作。
我查看了所有类似的问题及其解决方案,但似乎找不到任何直接适用于我的情况的问题。
JavaScript:
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="icon" type="image/ico" href="../images/favicon.ico">
<script type="text/javascript" src="js/tinybox.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script>
$('#date').datepicker();
function delete(id)
{
var r=confirm("Are you sure you want to delete?")
if (r==true)
{
location.href = "delete.php?id=" + id;
}
}
function single(id)
{
TINY.box.show({iframe:'../view.php?id=' + id,boxid:'frameless',width:550,height:170,fixed:false,maskid:'bluemask',maskopacity:40,closejs:function(){closeJS()}})
}
</script>
html:
<input name="date" class="src_date" type="textarea" placeholder="DD-MM-YYYY" id="date" required>
我也试过用JS:
$(function() {
$("#date").datepicker({dateFormat: 'dd-mm-yyyy'});
});
【问题讨论】:
标签: javascript jquery html twitter-bootstrap datepicker