🐞 fix(guild): 修复周一加入无活人军团领奖励问题
This commit is contained in:
@@ -570,6 +570,22 @@ export function getFutureTime() {
|
||||
return moment('2100-01-01').unix();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断是不是今天
|
||||
* 不是标准的0点-24点,时间区间是: 今天5点-明天5点
|
||||
*
|
||||
* @export
|
||||
* @param {number} time 单位:秒
|
||||
* @return {*} {Boolean}
|
||||
*/
|
||||
export function isToday(time: number): Boolean {
|
||||
return moment().format('YYYYMMDD') === moment(time * 1000).format('YYYYMMDD');
|
||||
// 今天5点
|
||||
const startSeconds = getSeconds(getZeroPointD());
|
||||
// 明天5点
|
||||
const endSeconds = startSeconds + DAY_TO_SECOND;
|
||||
if ((time > startSeconds) && (time < endSeconds)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user