• 预约系统前端时间设置


    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"));
    }
    });
    });

  • 相关阅读:
    SVN操作异常
    VS2010安装MVC3
    (转)游戏类型
    (转)32位汇编指令 寄存器
    (转)#pragma 用法
    (转)UI库
    (转)简单实用的网游服务器架构
    (转)一个客户端网游市场分布的数据
    (转)源于魔兽!《植物大战僵尸》成功奥秘
    (转)【分析】中国网游行业上市公司投资分析之网易
  • 原文地址:https://www.cnblogs.com/lxboy2009/p/4312470.html
Copyright © 2020-2023  润新知