添加 dayUts 方法

This commit is contained in:
icssoa
2025-09-09 22:07:36 +08:00
parent cad8b0c482
commit 98e6bba643

View File

@@ -71,6 +71,27 @@ export class DayUts {
return result;
}
/**
* 本月多少天
*/
getDays(): number {
return new Date(this._date.getFullYear(), this._date.getMonth() + 1, 0).getDate();
}
/**
* 是否为闰年
*/
isLeapYear(): boolean {
return this._date.getFullYear() % 4 == 0 && this._date.getFullYear() % 100 != 0;
}
/**
* 星期几
*/
getDay(): number {
return this._date.getDay();
}
/**
* 获取某个单位的开始时间
*/