easyui dataBoxは1日増加し、1日減少
6639 ワード
<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();
});
});