军团:弹劾
This commit is contained in:
@@ -32,22 +32,10 @@ export function getBeforeDayDate(day: number) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 x天后的y点
|
||||
* @param curTime 现在时间
|
||||
* @param hour 几点刷新
|
||||
* 获取几天以前(按秒获取)
|
||||
* @param day 几天以前
|
||||
*/
|
||||
export function getRefTime(now = new Date(), checkHour: number, day = 0) {
|
||||
let curTime = new Date(now.getTime());
|
||||
if (checkHour < 0) {
|
||||
checkHour = 24 + checkHour;
|
||||
if (curTime.getHours() >= checkHour) {
|
||||
curTime.setDate(curTime.getDate() + 1);
|
||||
}
|
||||
} else {
|
||||
if (curTime.getHours() < checkHour) {
|
||||
curTime.setDate(curTime.getDate() - 1);
|
||||
}
|
||||
}
|
||||
let today = curTime.setHours(checkHour, 0, 0, 0);;
|
||||
return new Date(today + day * 24 * 60 * 60 * 1000);
|
||||
export function getBeforeDaySeconds(day: number) {
|
||||
let time = nowSeconds() - day * PER_DAY;
|
||||
return time;
|
||||
}
|
||||
Reference in New Issue
Block a user