0

我正在将(jquery-simple-datetimepicker)用于小型餐厅应用程序。餐厅的时间​​是早上 6 点到 12 点。我的问题是下拉菜单中的时间间隔从 00:00 到 23:30 开始,但它应该显示 1 小时的时间间隔。例如,如果当前时间是上午 10 点,则间隔应该从 6 小时后开始,即4:00, 5:00until 12:00 am。如果时间是7: pm或之后,那么它应该显示第二天的时间,即6:00,7:00直到12: am。我能在这个插件中实现还是你更喜欢任何其他可定制的插件?

这是我的代码

$('#datetimepicker2').appendDtpicker({
  todayButton: true,
  step: 60,
  closeOnSelected: true,
  minuteInterval: 30,
  onSelect: function() {},

  onInit: function(handler) {
    var picker = handler.getPicker();

  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://www.jqueryscript.net/demo/jQuery-Date-Time-Picke-Plugin-Simple-Datetimepicker/jquery.simple-dtpicker.js"></script>
<link type="text/css" href="https://www.jqueryscript.net/demo/jQuery-Date-Time-Picke-Plugin-Simple-Datetimepicker/jquery.simple-dtpicker.css" rel="stylesheet">
<input type="text" name="date9" id="datetimepicker2">

谁能帮帮我,好吗?

4

1 回答 1

0

试试 minuteInterval 60?

$('#datetimepicker2').appendDtpicker({
  todayButton: true,
  step: 60,
  closeOnSelected: true,
  minuteInterval: 60,
  minTime: "06:00",
  maxTime: "23:59",
  onSelect: function() {},

  onInit: function(handler) {
    var picker = handler.getPicker();

  }
});
于 2019-07-02T07:15:57.307 回答