MCPcopy Index your code
hub / github.com/CapSoftware/Cap / generateRandomTimestamp

Function generateRandomTimestamp

scripts/analytics/populate-test-data.js:44–50  ·  view source on GitHub ↗
(daysAgo = 30)

Source from the content-addressed store, hash-verified

42}
43
44function generateRandomTimestamp(daysAgo = 30) {
45 const now = Date.now();
46 const daysAgoMs = daysAgo * 24 * 60 * 60 * 1000;
47 const randomMs = Math.random() * daysAgoMs;
48 const timestamp = new Date(now - randomMs);
49 return timestamp.toISOString();
50}
51
52function generateSessionId(videoId, timestamp, city, browser, index) {
53 const day = timestamp.slice(0, 10);

Callers 1

generateTestEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected