MCPcopy Create free account
hub / github.com/appium/appium / getLastMonthDateRange

Function getLastMonthDateRange

scripts/crowdin-stats.mjs:17–28  ·  view source on GitHub ↗

* Get the date range for the last calendar month * @returns {{from: string, to: string}}

()

Source from the content-addressed store, hash-verified

15 * @returns {{from: string, to: string}}
16 */
17function 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

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected