* Get the date range for the last calendar month * @returns {{from: string, to: string}}
()
| 15 | * @returns {{from: string, to: string}} |
| 16 | */ |
| 17 | function getLastMonthDateRange() { |
| 18 | const now = new Date(); |
| 19 | // First day of last month at 00:00:00 UTC |
| 20 | const from = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() - 1, 1, 0, 0, 0)); |
| 21 | // Last day of last month at 23:59:59 UTC |
| 22 | const to = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 0, 23, 59, 59)); |
| 23 | |
| 24 | return { |
| 25 | from: from.toISOString(), // Full ISO 8601 format with UTC: YYYY-MM-DDTHH:mm:ss.sssZ |
| 26 | to: to.toISOString(), |
| 27 | }; |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Generate a translation activity report |