Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

bugfix: timezone issue with template block cutoff date (#46601)

Stephen Morgan2b1ba5075376
diff --git a/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.utils.ts b/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.utils.ts
index 91a8389f598..466d03c51bb 100644
--- a/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.utils.ts
+++ b/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.utils.ts
@@ -1,10 +1,13 @@
import dayjs from 'dayjs'
+import utc from 'dayjs/plugin/utc'
import { isSmtpEnabled } from '../SmtpForm/SmtpForm.utils'
import { type AuthTemplateType, type KebabCase } from './EmailTemplates.types'
import type { components } from '@/data/api'
import type { Organization } from '@/types'
+dayjs.extend(utc)
+
type AuthConfig = components['schemas']['GoTrueConfigResponse']
/**
@@ -46,7 +49,7 @@ export const isCustomEmailTemplateRestrictionStatusKnown = ({
}
export const isBeforeFreeTierTemplateBlockCutoff = (projectInsertedAt?: string) => {
- return dayjs(projectInsertedAt).isBefore(FREE_TIER_TEMPLATE_BLOCK_CUTOFF_DATE)
+ return dayjs.utc(projectInsertedAt).isBefore(FREE_TIER_TEMPLATE_BLOCK_CUTOFF_DATE)
}
export const isCustomEmailTemplateEditingRestricted = ({