wuchao
function changeDeadline() {
        var days = parseInt(document.getElementById("<%=hd_days.ClientID %>").value);
        var datetemp = document.getElementById("<%=tb_cir.ClientID %>").value
        var CurrentDate = datetemp.replace("-","/");

        var tarDate = new Date(CurrentDate);
        var deadline = document.getElementById("<%=tb_deadline.ClientID %>").value;
        var temp = 0;
        for (i = 1; i <= days; i++) {
            tarDate = new Date((tarDate).valueOf() + 1 * 24 * 60 * 60 * 1000);
            //alert();
            if ((tarDate.getDay() == 0) || (tarDate.getDay() == 6)) {
                days++;
            }
        }

        document.getElementById("<%=tb_deadline.ClientID %>").value = tarDate.getFullYear() + "-" + (tarDate.getMonth() + 1) + "-" + tarDate.getDate();
        document.getElementById("<%=hd_deadline.ClientID %>").value = tarDate.getFullYear() + "-" + (tarDate.getMonth() + 1) + "-" + tarDate.getDate();
    }

    // 将日期类型转换成字符串型格式yyyy-MM-dd  

    function ChangeDateToString(DateIn) {
        var Year = 0;
        var Month = 0;
        var Day = 0;

        var CurrentDate = "";

        //初始化时间
        Year = DateIn.getYear();
        Month = DateIn.getMonth() + 1;
        Day = DateIn.getDate();


        CurrentDate = Year + "-";
        if (Month >= 10) {
            CurrentDate = CurrentDate + Month + "-";
        }
        else {
            CurrentDate = CurrentDate + "0" + Month + "-";
        }
        if (Day >= 10) {
            CurrentDate = CurrentDate + Day;
        }
        else {
            CurrentDate = CurrentDate + "0" + Day;
        }


        return CurrentDate;
    }

 

分类:

技术点:

相关文章:

  • 2021-11-27
  • 2022-01-01
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-01-01
猜你喜欢
  • 2022-01-01
  • 2022-01-29
  • 2022-12-23
  • 2021-06-09
  • 2021-10-25
  • 2021-11-27
  • 2021-11-27
相关资源
相似解决方案