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

Function getLastMonthDateRange

scripts/github-contrib-stats.mjs:88–98  ·  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

86 * @returns {{from: string, to: string}}
87 */
88function getLastMonthDateRange() {
89 const now = new Date();
90 // First day of last month at 00:00:00 UTC
91 const from = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() - 1, 1, 0, 0, 0));
92 // Last day of last month at 23:59:59 UTC
93 const to = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 0, 23, 59, 59));
94 return {
95 from: from.toISOString(),
96 to: to.toISOString(),
97 };
98}
99
100/**
101 * Make request to GitHub API (authenticated or unauthenticated)

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected