zoukankan      html  css  js  c++  java
  • easyui dataBox 增加一天,减少一天

    <table>
            <tr>
                <td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="Previousday()">上一天</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="NextDay()">下一天</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="ToExcel()">报表输出</a>
                </td>
            </tr>
            <tr>
                <td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="RunRanking()">计算排名</a>
                </td>
            </tr>
            <tr>
                <td>
                    <input id="CreateDate" name="CreateDate" class="easyui-datebox"></input></td>
            </tr>
        </table>
    <script>
        var CreateDate_Temp;
        $('#CreateDate').datebox({
            onSelect: function (date) {
                CreateDate_Temp = $('#CreateDate').datebox('getValue');
                Search();
            }
        });
        function Search() {
            if (CreateDate_Temp == "") {
                return;
            }
            $('#datagrid').datagrid({
                url: '@Url.Action("Index", "EveryDayPointReport")' + "?createDate=" + CreateDate_Temp
            });
        $('#datagrid').datagrid("fitColumns");
    
    }
    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');
        Search();
    }
    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');
        Search();
    }
    $(document).ready(function () {
        $(function () {
            var curr_time = new Date();
            var strDate = curr_time.getFullYear() + "-";
            strDate += curr_time.getMonth() + 1 + "-";
            strDate += curr_time.getDate() + "-";
            strDate += curr_time.getHours() + ":";
            strDate += curr_time.getMinutes() + ":";
            strDate += curr_time.getSeconds();
            $("#CreateDate").datebox("setValue", strDate);
            CreateDate_Temp = $('#CreateDate').datebox('getValue'); Search();
        });
    });
  • 相关阅读:
    javaweb-番外篇-Commons-FileUpload组件上传文件
    javaweb-3-在Eclipse中引入Tomcat
    javaweb-2-Tomcat初步学习与使用
    javaweb-1-B/S初论
    jdk安装与配置
    程序、计算机程序、java初论
    RPC原理及RPC实例分析
    java堆排序(大根堆)
    数据结构——堆(Heap)大根堆、小根堆
    Spring事务传播机制和数据库隔离级别
  • 原文地址:https://www.cnblogs.com/bingguang/p/4683219.html
Copyright © 2011-2022 走看看