我已添加到我的页面Bootstrap datepicker。它有效,但如果我在日历视图中选择时钟视图,我就无法返回日历并禁用该视图。
包括:
<script src="../resources/js/jquery.min.js"></script>
<script src="../resources/js/moment.js"></script>
<script src="../resources/js/bootstrap.min.js"></script>
<script src="../resources/js/bootstrap-datetimepicker.min.js"></script>
<script src="/resources/js/dodajDP.js"></script>
<script src="../resources/js/zegarodliczajacy.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../resources/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../resources/css/style.css">
<link rel="stylesheet" type="text/css" href="../resources/fonts/awesome/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="../resources/css/bootstrap-datetimepicker.min.css">
添加选择器: HTML
<div class="form-group row">
<label class="col-sm-4 control-label">Rozpoczęcie zawodów:</label>
<div id="datetimepicker1" class="input-group col-sm-4 input-group">
<input class='form-control form-date' type="text" name="startZawodow" value="<?php echo $_POST[" startZawodow "];?>" />
<span class="input-group-addon">
<span class="fa fa-calendar"></span>
</span>
</div>
<div class='col-sm-4'>
<span>
<?php sprawdzPoprawnoscCzasuFormularza("timestamp", "startZawodow"); sprawdzCzyNiePuste("koniecZawodow");?>
</span>
</div>
</div>
JavaScript的:
function dodajZData(id) {
$(id).datetimepicker({
format: 'YYYY-MM-DD HH:mm:ss',
locale: 'PL'
});
}