(date: Date)
| 79 | const min = String(date.getMinutes()).padStart(2, "0"); |
| 80 | return `${y}/${m}/${d} ${h}:${min}`; |
| 81 | } |
| 82 | |
| 83 | function getTodayStart(): number { |
| 84 | const now = new Date(); |
| 85 | now.setHours(0, 0, 0, 0); |
| 86 | return Math.floor(now.getTime() / 1000); |
| 87 | } |
| 88 | |
| 89 | // 解析时间参数:2h -> 2小时, 30m -> 30分钟 |
| 90 | function parseTimeLimit(s: string): number | null { |
| 91 | const match = s.match(/^(\d+)(h|m)$/i); |