您的位置:首页 > 其它

在日期控件中提取日期数据,并在另一个文本框中显示其年份加1 |

2016-07-01 14:38 281 查看
<td class="back">启用日期:



<input id="vc_fdate" name="vc_fdate" type="text" class="easyui-datebox form-control" value=""/>



截止日期:
<input id="vc_tdate" name="vc_tdate" type="text" class="easyui-datebox form-control" value="" readonly/>
</td>

$Dialog().date($('#vc_fdate'),function(){

var fdate = $("#vc_fdate").val();
var _tdate = addDate(fdate,'365');
var tdate = _tdate.getFullYear()+"-"+(_tdate.getMonth()+1)+"-"+_tdate.getDate();
$("#vc_tdate").val(tdate);
});

});

function addDate(vc_tdate,vc_fdate){
var a = new Date(vc_tdate);
a = a.valueOf();
a = a + vc_fdate * 24 * 60 * 60 * 1000;
a = new Date(a);
return a;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: