javascritp 實現上週,下週,本週查詢

2021-06-18 03:13:20 字數 881 閱讀 5478

// 執行周查詢

type:表示查詢的種類(上週:-1 本週:0 下週:1)

function doweekquery(type)else

// 獲得周一時間

sheetmanform.queryplanstarttimebegin.value = getdate(vmonday)+" 00:00";

// 獲得週日時間

sheetmanform.queryplanfinishtimeend.value = getdate(vsunday)+" 23:59";

sheetmanform.actiontype.value = "query";

sheetmanform.submit(); }

// 根據時間字串組裝時間,獲得需要的周一時間

function comparedate(stringdate)else

return vreturn; }

// 獲得乙個時間對應的周一的時間

function getmonday(date)

// 獲得乙個時間對應的週日的時間

function getsunday(date)

// 獲得乙個時間是本週的的幾天,星期一:1 星期天:7

function getdayofweek(date)

return vdateofweek; }

// 根據自2023年1月1的毫秒數換算成時間

function getdate(milliseconds)

var vday = vnewdate.getdate();

if(vday < 10)

return vyear + "-" + vmonth + "-" + vday; }

0 給主人留下些什麼吧!~~

javascritp 實現上週,下週,本週查詢

執行周查詢 type 表示查詢的種類 上週 1 本週 0 下週 1 function doweekquery type else 獲得周一時間 sheetmanform.queryplanstarttimebegin.value getdate vmonday 00 00 獲得週日時間 sheetm...

同比環比上週上月的問題實現方案

需求 在乙個折線圖中同時顯示三條線,第一條線顯示start time到endtime之內的資料 第二條線顯示start time 7到endtime 7之內的資料 第三條線顯示start time 30到endtime 30之內的資料 另註 當前日期 2017 11 12 10 15 01 1 or...

Windows下實現PostgreSQL自動備份

本文介紹怎樣建立乙個windows批處理檔案來自動備份postgresql資料庫。背景 在我工作上乙個使用postgresql資料庫的專案上需要乙個自動化系統來每天執行備份。經過一番研究決定通過建立乙個windows批處理檔案並新增到windows計畫任務中來實現。下面是具體步驟 怎樣配置 第一步 ...