zoukankan      html  css  js  c++  java
  • 获取所选月份指定时间范围

    //获取当前月份
    page.getNowFormatDate = function() {
        var date = new Date();
        var seperator1 = "-";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate ;
        return currentdate;
    };

    //获取所选月份的第一天
    page.getCurrentMonthFirst = function(){
         var startdate=new Date($("#datetime").val());
         startdate.setDate(1);
         return startdate;
    };
    //获取所选月份的最后一天
    page.getCurrentMonthLast = function(){
         var endDate = new Date($("#datetime").val());
         var month=endDate.getMonth();
         var nextMonth=++month;
         var nextMonthFirstDay=new Date(endDate.getFullYear(),nextMonth,1);
         var oneDay=1000*60*60*24;
         return new Date(nextMonthFirstDay-oneDay);
    };

  • 相关阅读:
    Codeforces 474B. Worms
    Codeforces 577A
    Codeforces 455A
    Codeforces 540A
    Codeforces 832A. Sasha and Sticks
    51Nod 1137 矩阵乘法
    51Nod 1118 机器人走方格
    Tomcat部署项目的三种方式
    【Linux】CentOS7下安装JDK详细过程
    Linux上安装rz和sz命令
  • 原文地址:https://www.cnblogs.com/jimmyLei/p/8533752.html
Copyright © 2011-2022 走看看