function getValue() {
var tb = document.getElementById('<%=isordered.ClientID %>');
var radioArray = tb.getElementsByTagName('input');
for (var i = 0, len = radioArray.length; i < len; i++) {
if (radioArray[i].type == 'radio' && radioArray[i].checked) {
//alert(radioArray[i].value);
return radioArray[i].value;
}
}
}
Date.prototype.Format = function (fmt) { //author: meizz
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
$(function () {
//添加change事件
$("#<%=isordered.ClientID %>").change(function () {
var SelectVal = getValue();
//alert(SelectVal);
if (SelectVal == '0') {
// $("#hidden_tr1").hide();
// $("#hidden_tr2").hide();
}
else {
var t = $("#<%=STime.ClientID %>").val();
str = t.replace(/-/g, "/");
var date = new Date(str);
var year = date.getFullYear();
var month = date.getMonth();
var date1 = date.getDate();
var hour = date.getHours();
var min = date.getMinutes();
var nextDay = new Date(year, month, date1 - 7, hour, min).Format("yyyy-MM-dd hh:mm");
$("#<%=orderstarttime.ClientID %>").val(nextDay);
$("#<%=orderendtime.ClientID %>").val(new Date(year, month, date1, hour - 2, min).Format("yyyy-MM-dd hh:mm"));
}
});
});