如何操作首先由AnyTime选取器生成的值?例如,我有一个输入字段,上面有AnyTime。当我单击该字段时,它将填充当前时间,并且我希望它填充下一轮小时。
发布于 2010-08-12 17:32:43
尝试更改这些anytime.js行
// Initialize the picker's date/time value.
try
{
this.time = this.conv.parse(this.inp.val());
this.offMin = this.conv.getUtcParseOffsetCaptured();
this.offSI = this.conv.getUtcParseOffsetSubIndex();
}
catch ( e )
{
this.time = new Date();
}至
// Initialize the picker's date/time value.
try
{
this.time = this.conv.parse(this.inp.val());
this.offMin = this.conv.getUtcParseOffsetCaptured();
this.offSI = this.conv.getUtcParseOffsetSubIndex();
}
catch ( e )
{
this.time = new Date();
this.time.setHours(this.time.getHours()+1,0,0,0);
}发布于 2011-03-14 18:36:35
选择器使用字段中的时间作为初始值,如果字段无法解析,则仅默认为当前时间。初始化选取器的最简单方法是在字段中填入所需的起始值,并确保其格式正确。
https://stackoverflow.com/questions/3465786
复制相似问题