MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / getProgressDateTimestamp

Function getProgressDateTimestamp

utils/progresses.js:22–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 * @returns {Date} A date object representing the current time in IST Timezone
21 */
22const getProgressDateTimestamp = () => {
23 // Currently, we are primarily catering to Indian users for our apps, which is why we have implemented support for the IST (Indian Standard Time) timezone for progress updates.
24 const currentHourIST = new Date().getUTCHours() + 5.5; // IST offset is UTC+5:30;
25 const isBefore6amIST = currentHourIST === 5.5 && new Date().getUTCMinutes() <= 30;
26 return isBefore6amIST ? new Date().setUTCHours(0, 0, 0, 0) - MILLISECONDS_IN_DAY : new Date().setUTCHours(0, 0, 0, 0);
27};
28
29/**
30 * Builds a Firestore query for posting progress documents based on the given parameters.

Callers 1

createProgressDocumentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected