eonasdan bootstrap:无法使用小时箭头图标增加小时数 [英] eonasdan bootstrap: unable to increase hours using hour arrow icon

查看:17
本文介绍了eonasdan bootstrap:无法使用小时箭头图标增加小时数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Eonasdan datetimepicker 版本:4.17.47 通过导入 此 JS 文件在项目中.

此外,我正在使用一些自定义验证来确保当用户输入与预期不同的时间范围时显示红色文本.我没有设置 minDatemaxDate 因为时间范围是动态的并且可以更改.

有时,用户无法通过单击向上箭头键来增加小时/分钟.datetimepicker 设置为仅用于时间,因此初始化为:

$("#timePicker").datetimepicker({格式:LT",允许输入切换:真,keepInvalid: true//向上箭头图标不起作用,所以我认为这会解决它,但它没有});

和模板:

<div class="control input-group customtextInput";id="timePicker"><输入类型=文本"id=时间"名称=时间"class="inputText col-md-12 form-control time-picker";数据绑定=事件:{模糊:函数(数据,事件){$parent.handleDateTimeOnblur.bind(数据,$parent,事件)()}}";需要/><span class="input-group-addon">...</span>

<p class="text-danger login-error-msg time-empty";id=时间错误"aria-label="错误信息";数据绑定=文本:$parent.timeErrorMessage()";角色=警报"></p>

您可以在此处

查看演示

我注意到当用户尝试使用 datetimepicker 转到下一个日期时,它会停止递增(此给定页面上的日期选择器未连接,它们被单独初始化.)

对此的任何帮助将不胜感激!

解决方案

我们现在修复了这个问题.请参阅 GitHub 上的讨论

I am using Eonasdan datetimepicker version : 4.17.47 by importing this JS file in a project.

Also, I am using some custom validation to make sure that shows a red text when the user enters a time range different than expected. I am no setting minDate or maxDate because the time range is dynamic and can be changed.

Sometimes though, the user is unable to increment hours / minutes by clicking on the up arrow key. The datetimepicker is set to use for only time, thus initialized as:

$("#timePicker").datetimepicker({
        format: "LT",
        allowInputToggle: true,
        keepInvalid: true // the up arrow icon was not working, so I thought this will fix it but it didn't
      });

and the template:

<div class="form-group col-sm-6 time-block">
   <div class="control input-group customtextInput" id="timePicker">
      <input type="text" id="stime" name="time" class="inputText col-md-12 form-control time-picker"
         data-bind="event:{ blur: function (data, event) {$parent.handleDateTimeOnblur.bind(data, $parent, event)() } }"
         required />
      <span class="input-group-addon">
         ...
      </span>
   </div>
   <p class="text-danger login-error-msg time-empty" id="time-error" aria-label="Error Message"
      data-bind="text: $parent.timeErrorMessage()" role="alert"></p>
</div>

You can see a demo here

I've noticed that when user tries to go to next date using the datetimepicker, it stops incrementing, (The date pickers on this given page are not connected, they are seperately initialized.)

Any help regarding this will be truly appreciated!!

解决方案

This issue us fixed now. See Discussion on GitHub

这篇关于eonasdan bootstrap:无法使用小时箭头图标增加小时数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆