在DateTimePicker中设置小时超过23 [英] set hour in DateTimePicker more than 23

查看:78
本文介绍了在DateTimePicker中设置小时超过23的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我需要使用格式为HH:MM的Timepicker,但我将其用作持续时间,而不是时间,因此有可能将HH增大到99,而不是以23停止!

In my project , I need using Timepicker with format HH:MM , but I use it like duration , not a time , so is it possible to increase HH upto 99 , not stop in 23 !

我在此页面上使用日期时间选择器: http://tarruda.github。 io / bootstrap-datetimepicker /

I using datetime picker from this page : http://tarruda.github.io/bootstrap-datetimepicker/

经过几次编辑js文件后,我发现必须在< a href = http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js rel = nofollow> http://tarruda.github.com/bootstrap-datetimepicker/ asset / js / bootstrap-datetimepicker.min.js 文件来获取我的目标!

After several time to edit js file , I found that I must change js code in "getUTCHours()" method from http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js file to get my goal !

但是我找不到此方法的定义:(

But I cannot find the define of this method :(

有人可以帮助我吗?谢谢大家!

Can anyone help me ? Thanks all in advances !

Valentino!

Valentino !

推荐答案

是的,代码有条件,只要检测到小时,
等于或大于23
,它将重置为23。

Yes it is possible, the code has a condition that whenever it detects the hour is equal or greater than 23 it will reset to 23.

在此代码中没有限制。

在Bootstrap.timepicker.js

In Bootstrap.timepicker.js

在代码中搜索 23或 24

Search for "23" or "24" in the code

您将找到以下

`this.hour>=24?this.hour = 23`

我更改为

this。 hour> = 24?this.hour = this.hour 没有限制。

要使其达到99改变它。

To make it Up to 99 changue it to.

`this.hour>99?this.hour = 99`     **UP to 99**

请务必使用

`showMeridian = false`, 

使其工作。

我在MYSQL中使用时间变量类型,并且工作正常。

Im using "time" variable type in MYSQL and is working just fine.

现在可以使用了。

这篇关于在DateTimePicker中设置小时超过23的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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