在引导日期时间选择器中选择时间后关闭日期时间选择器日历

时间:2020-08-14 19:20:05

标签: jquery twitter-bootstrap datetimepicker

我添加了datetimepicker,但是在选择日期和时间日历后,不会自动隐藏或关闭。那么我该如何在时间隐藏或关闭眼窝呢?我的意思是,当最终选择PM $(".datetimepicker").datetimepicker({ format: 'MM/DD/YYYY hh:mm A', // A ////format: 'MM/DD/YYYY', // A icons: { time: "fa fa-clock", date: "fa fa-calendar", up: "fa fa-arrow-up", down: "fa fa-arrow-down" } }).on('changeDate', function (e) { $(this).datetimepicker('hide'); });时,日历将隐藏。这是我的代码自爆。

<!-- 
  You should be able to change the version numbers below to match the versions you're using in your app. 
  You will likely need to remove the integrity attributes if you do. 
-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>

<input type="text" class="datetimepicker">
  dx_code patient_id                           dx_name  year
0  427.31    Z324563     Atrial fibrillation (CMS/HCC)  2012
1   H53.9    Z324563                Visual disturbance  2014
2     725    Z324563  Polymyalgia rheumatica (CMS/HCC)  2009
3     725    Z324563  Polymyalgia rheumatica (CMS/HCC)  2011
4    None    Z273652    Disorder of bone and cartilage  2004
5   272.0    Z273652         Pure hypercholesterolemia  2006
6  729.81    Z273652                  Swelling of limb  2012
7   446.5    Z273652    Giant cell arteritis (CMS/HCC)  2010
8     725    Z273652  Polymyalgia rheumatica (CMS/HCC)  2011

0 个答案:

没有答案