标签:javascrip get java name new var input val script
var Stamp;
Stamp = new Date();
var num = 7-Stamp.getDay()+1;
Stamp.setDate(Stamp.getDate() + num);
var year = Stamp.getFullYear(); //获取完整的年份(4位,1970-????)
var month = Stamp.getMonth() +1; //获取当前月份(0-11,0代表1月)
var mvar =‘‘;
if(month<10){
mvar = ‘0‘ + month;
}else{
mvar = month+‘‘;
}
var day = Stamp.getDate();
var dvar =‘‘;
if(day<10){
dvar = ‘0‘ + day;
}else{
dvar = day+‘‘;
}
$("input[name=‘wkplan.CYCLE‘]").val(year+"-"+mvar+‘-‘+dvar);
标签:javascrip get java name new var input val script
原文地址:http://www.cnblogs.com/wjwlwt/p/7277824.html