Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

feat(constants): add the operator pass early bird end date

Hampus3dc2713ab7ce
diff --git a/packages/constants/src/OperatorPassEarlyBird.ts b/packages/constants/src/OperatorPassEarlyBird.ts
new file mode 100644
index 000000000..2654dc515
--- /dev/null
+++ b/packages/constants/src/OperatorPassEarlyBird.ts
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+const WESTERNMOST_UTC_OFFSET_MS = -12 * 60 * 60 * 1000;
+const DAY_MS = 24 * 60 * 60 * 1000;
+
+export function getOperatorPassEarlyBirdEndsOn(priceRisesAt: Date | string): string {
+ const risesAt = typeof priceRisesAt === 'string' ? Date.parse(priceRisesAt) : priceRisesAt.getTime();
+ return new Date(risesAt + WESTERNMOST_UTC_OFFSET_MS - DAY_MS).toISOString().slice(0, 10);
+}