00832d76
“wangming”
fix: 上午半天假过点仍可打上班...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
function pad2(n) {
return String(n).padStart(2, '0')
}
/** 默认区间:当月 1 日 → 今天 */
export function getDefaultDateRange() {
const now = new Date()
const year = now.getFullYear()
const month = now.getMonth() + 1
const day = now.getDate()
return [`${year}-${pad2(month)}-01`, `${year}-${pad2(month)}-${pad2(day)}`]
}
export function dateToStatisticsMonth(dateStr) {
if (!dateStr) return ''
return String(dateStr).replace(/-/g, '').slice(0, 6)
}
|