如何在 JQM 日期框时间翻转框中隐藏无效的分钟和小时



例如,下面的代码不允许用户选择除 0、15、30 和 45 之外的任何分钟。但是其他分钟是可见的,尽管您将无法选择它们。

<div class="ui-field-contain">
  <label for="mode4">Dropoff Time</label>
  <input data-options='{"mode":"timeflipbox","minuteStep":"15","minuteStepRound":"1","useFocus":"true","overrideTimeOutput":"%l:%M %p"}' data-role="datebox" id="mode4" name="mode4" type="text"></input>
</div>

如何隐藏除 0、15、30 和 45 之外的所有分钟,以便只有这 4 分钟可见以供选择?

作为旁注,除了jqm datebox和mobiscroll之外,还有其他jqm扩展提供了时间和日期选择的翻转功能吗?

你的代码实际上是正确的 - DateBox 不遵守 flipbox 中的 minuteStep 指令是一个错误,而不是预期的行为。

更改如下: https://github.com/jtsage/jquery-mobile-datebox/commit/9df43c5e37409db460f7d2ea368b506427c8b71e

原始错误报告在这里: https://github.com/jtsage/jquery-mobile-datebox/issues/362

最新更新