Skip to content

@pmun/utils / getThisWeekRange

Function: getThisWeekRange()

ts
function getThisWeekRange(): DateRange;

获取本周的开始和结束时间戳(周一到周日)

Returns

DateRange

日期范围元组 [开始时间戳, 结束时间戳]

Example

ts
const [start, end] = getThisWeekRange()
// start: 本周一 00:00:00 的时间戳
// end: 本周日 23:59:59.999 的时间戳