• 关于前台日期转换和比较大小以及今天前三天日期


      var meetingDate = new Date();
          $scope.meetingYear = meetingDate.getFullYear();
          $scope.meetingMonth = meetingDate.getMonth() + 1;
          $scope.meetingDay = meetingDate.getDate();
          $scope.meetingHour = meetingDate.getHours();
          $scope.meetingMinutes = meetingDate.getMinutes();
          $scope.dateStr = meetingDate.getFullYear() + "-" + ((meetingDate.getMonth() + 1) < 10 ? "0" : "") + (meetingDate.getMonth() + 1) + "-" + (meetingDate.getDate() < 10 ? "0" : "") + meetingDate.getDate();

     function formatDate(date) {
             var year = date.getFullYear();
             var month = date.getMonth() + 1;
             var day = date.getDate();
             var hour = date.getHours();
             var minute = date.getMinutes();
             var second = date.getSeconds();
             return year + "-" + formatTen(month) + "-" + formatTen(day);

          }




    $scope.siteNewEndDate = siteEndDate.getFullYear() + "-" + ((siteEndDate.getMonth() + 1) < 10 ? "0" : "") + (siteEndDate.getMonth() + 1) + "-" + (siteEndDate.getDate() < 10 ? "0" : "") + siteEndDate.getDate() +
                " " + ((siteEndDate.getHours() + 1) < 10 ? "0" : "") + (siteEndDate.getHours()) + ":" + ((siteEndDate.getMinutes() + 1) < 10 ? "0" : "") + (siteEndDate.getMinutes());
             var sDate = new Date($scope.siteStartDate.replace(/-/g, '/'));
             var eDate = new Date($scope.siteNewEndDate.replace(/-/g, '/'));

    前三天

     var threeAgo = sitebeginDate.getTime()-3*24*60*60*1000;
          $scope.beginDate = new Date(threeAgo).getFullYear() + "-" + ((new Date(threeAgo).getMonth() + 1) < 10 ? "0" : "") + (new Date(threeAgo).getMonth() + 1) + "-" + (new Date(threeAgo).getDate() < 10 ? "0" : "") + new Date(threeAgo).getDate();


  • 相关阅读:
    php 数组 暴力 JWT 密钥
    php jwt 算法
    设计模式(三)结构型模式
    设计模式(一)六大原则
    219. 存在重复元素 II
    设计模式(二)构建型模式
    Java设计模式与实践
    Android 裁切踩坑
    MarkDown语法
    设计模式(四)行为型模式
  • 原文地址:https://www.cnblogs.com/baobeiqi-e/p/9884775.html
Copyright © 2020-2023  润新知