Jquery datetimepicker不允许在以后的日期中使用 [英] Jquery datetimepicker doesn't allow to take previous time of future dates

查看:122
本文介绍了Jquery datetimepicker不允许在以后的日期中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有未来日期的jQuery datetimepicker控件,但有一个问题。它不允许采用前几个小时的未来日期

,例如当前时间是15.30。如果用户选择任何未来日期,则日期时间选择器不允许用户在30和15之前的小时前花费一小时。



 $( #+ MyID +)。datetimepicker({
minDate:-0,maxDate:+ 12M,
dateFormat:'dd-M-yy',changeMonth:true,
changeYear:true,
controlType:'select',
oneLine:true,
timeFormat:'hh:mm',
minTime:0:00,maxTime:23 :59
});
$(#+ MyID +)。datetimepicker(show);





代码有什么问题。任何建议。



设置

 hourMin:0 

在某种程度上解决了问题,但仍然是随机出现的情况。



提前致谢。



我的尝试:



在Google上搜索此问题,但未找到此案例的完美答案。已经使用过minTime& maxTime。

解决方案

(#+ MyID +)。datetimepicker({
minDate:-0,maxDate:+ 12M,
dateFormat:'dd-M-yy',changeMonth:true,
changeYear:true,
controlType:'select',
oneLine:true,
timeFormat:' hh:mm',
minTime:0:00,maxTime:23:59
});


(#+ MyID + ).datetimepicker( 节目);





代码有什么问题。任何建议。



设置

 hourMin:0 

在某种程度上解决了问题,但仍然是随机出现的情况。



提前致谢。



我的尝试:



在Google上搜索此问题,但未找到此案例的完美答案。已经使用过minTime& MAXTIME。


I have jQuery datetimepicker control for future dates but with one problem. It doesn't allow to take previous hours of future dates
eg current time is 15.30. If user selectes any future date then date time picker doesn't allow user to take hour before 15 and minutes before 30.

$("#" + MyID + "").datetimepicker({
    minDate: -0, maxDate: "+12M",
    dateFormat: 'dd-M-yy', changeMonth: true,
    changeYear: true,
    controlType: 'select',
    oneLine: true,
    timeFormat: 'hh:mm',
    minTime: "0:00", maxTime: "23:59"
});
$("#" + MyID + "").datetimepicker("show");



What is the issue with code. Any suggestion.

Setting

hourMin: 0

solves the issue for some extent but still case occurs randomly.

Thanks in advance.

What I have tried:

Searching on google for this issue but not perfect answer found for this case. Already used minTime & maxTime.

解决方案

("#" + MyID + "").datetimepicker({ minDate: -0, maxDate: "+12M", dateFormat: 'dd-M-yy', changeMonth: true, changeYear: true, controlType: 'select', oneLine: true, timeFormat: 'hh:mm', minTime: "0:00", maxTime: "23:59" });


("#" + MyID + "").datetimepicker("show");



What is the issue with code. Any suggestion.

Setting

hourMin: 0

solves the issue for some extent but still case occurs randomly.

Thanks in advance.

What I have tried:

Searching on google for this issue but not perfect answer found for this case. Already used minTime & maxTime.


这篇关于Jquery datetimepicker不允许在以后的日期中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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