拍卖行:拍品起止时间
This commit is contained in:
@@ -129,4 +129,19 @@ export function formatTime(d: Date, type: number) {
|
||||
if(month < 10) monthStr = '0' + monthStr;
|
||||
return `${yearStr}/${monthStr}/${dayStr}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取指定时间后的某个时间点,如给定 date 后的晚八点整
|
||||
* @export
|
||||
* @param {Date} date 给定时间
|
||||
* @param {number} h 给定小时
|
||||
* @param {number} [m=0] 给定分钟
|
||||
* @param {number} [s=0] 给定秒
|
||||
* @returns {Date}
|
||||
*/
|
||||
export function getNextTime(date: Date, h: number, m = 0, s = 0): Date {
|
||||
const milliseconds = date.getTime();
|
||||
const timeToday = new Date(milliseconds).setHours(h, m, s);
|
||||
return timeToday > milliseconds ? new Date(timeToday) : new Date(timeToday + PER_DAY * PER_SECOND);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user