• js 上一天、下一天


    function Previousday() {
    
        var curDate = new Date(CreateDate_Temp);
        var preDate = new Date(curDate.getTime() - 24 * 60 * 60 * 1000);
    
        var strDate = preDate.getFullYear() + "-";
        strDate += preDate.getMonth() + 1 + "-";
        strDate += preDate.getDate() + "-";
        strDate += preDate.getHours() + ":";
        strDate += preDate.getMinutes() + ":";
        strDate += preDate.getSeconds();
        $("#CreateDate").datebox("setValue", strDate);
        CreateDate_Temp = $('#CreateDate').datebox('getValue');
    }
    function NextDay() {
    
        // var nextDate = new Date(curDate.getTime() + 24*60*60*1000);
        var curDate = new Date(CreateDate_Temp);
        var nextDate = new Date(curDate.getTime() + 24 * 60 * 60 * 1000);
    
        var strDate = nextDate.getFullYear() + "-";
        strDate += nextDate.getMonth() + 1 + "-";
        strDate += nextDate.getDate() + "-";
        strDate += nextDate.getHours() + ":";
        strDate += nextDate.getMinutes() + ":";
        strDate += nextDate.getSeconds();
        $("#CreateDate").datebox("setValue", strDate);
        CreateDate_Temp = $('#CreateDate').datebox('getValue');
    }

    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="Previousday()">上一天</a>
                        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="NextDay()">下一天</a>

     <input id="CreateDate" name="CreateDate" class="easyui-datebox"></input>

  • 相关阅读:
    将Tue Feb 22173124 CST2022换为20220222
    curl命令
    部署高可用kafka暴露外网访问并使用go代码测试
    转发:自定义博客园cnblog主题样式Ⅱ(SimpleMemory)
    npm与cnpm切换使用
    从层序遍历构造一棵二叉树
    【ORACLE】“IMP00013: 只有 DBA 才能导入…”解决方法
    vimeasymotion操作
    fd详解
    fasd用法
  • 原文地址:https://www.cnblogs.com/bingguang/p/4747215.html
Copyright © 2020-2023  润新知