From 2b1ba5075376cccf665d57ff3dbdb4769894567a Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Wed, 3 Jun 2026 15:56:20 +1200 Subject: [PATCH] bugfix: timezone issue with template block cutoff date (#46601) Fix to small issue with our block to free tier. The /project endpoint does not return a timestamp so it is being interpreted as local. ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Resolved timezone handling inconsistencies in email template availability checks to ensure accurate and consistent results across all geographic locations and server configurations. --- .../interfaces/Auth/EmailTemplates/EmailTemplates.utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.utils.ts b/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.utils.ts index 91a8389f598ba..466d03c51bb59 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 = ({