2021-11-18 16:31:42 +08:00
|
|
|
export const getQueryString=(name)=>{
|
|
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
|
if (r != null) return unescape(r[2]);
|
|
|
|
return null;
|
2021-11-24 15:13:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 前30天的时间段
|
|
|
|
export const nowMonth = () => {
|
|
|
|
const end = new Date();
|
|
|
|
const start = new Date();
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
return start
|
|
|
|
}
|
|
|
|
|
|
|
|
// 当前的时间段
|
|
|
|
export const nowDay = () => {
|
|
|
|
const end = new Date();
|
|
|
|
return end
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 补0操作
|
|
|
|
function buling (num) {
|
|
|
|
if (num < 10) {
|
|
|
|
return '0' + num
|
|
|
|
} else {
|
|
|
|
return num
|
|
|
|
}
|
|
|
|
}
|