From c0ff7636447cbb82d34ca61cee35fc81c112d4d0 Mon Sep 17 00:00:00 2001 From: abradat Date: Mon, 16 Sep 2024 15:14:48 -0700 Subject: [PATCH] Fix timezone difference issue not showing some meetings happening on today --- .../application-decision-meeting.service.ts | 12 ++++++------ .../planning-review-meeting.service.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/services/apps/alcs/src/alcs/application/application-decision-meeting/application-decision-meeting.service.ts b/services/apps/alcs/src/alcs/application/application-decision-meeting/application-decision-meeting.service.ts index 57dbb5a96..a9fb84c99 100644 --- a/services/apps/alcs/src/alcs/application/application-decision-meeting/application-decision-meeting.service.ts +++ b/services/apps/alcs/src/alcs/application/application-decision-meeting/application-decision-meeting.service.ts @@ -135,9 +135,9 @@ export class ApplicationDecisionMeetingService { .addSelect( ` CASE - WHEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE) THEN meeting.date END) is NOT NULL - THEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE) THEN meeting.date END) - ELSE MAX(CASE WHEN meeting.date < (CURRENT_DATE) THEN meeting.date END) + WHEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) is NOT NULL + THEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) + ELSE MAX(CASE WHEN meeting.date < (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) END `, 'next_meeting', @@ -159,9 +159,9 @@ export class ApplicationDecisionMeetingService { .addSelect( ` CASE - WHEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE) THEN meeting.date END) is NOT NULL - THEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE) THEN meeting.date END) - ELSE MAX(CASE WHEN meeting.date < (CURRENT_DATE) THEN meeting.date END) + WHEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) is NOT NULL + THEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) + ELSE MAX(CASE WHEN meeting.date < (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) END `, 'next_meeting', diff --git a/services/apps/alcs/src/alcs/planning-review/planning-review-meeting/planning-review-meeting.service.ts b/services/apps/alcs/src/alcs/planning-review/planning-review-meeting/planning-review-meeting.service.ts index 3df8e7b7d..9695c9664 100644 --- a/services/apps/alcs/src/alcs/planning-review/planning-review-meeting/planning-review-meeting.service.ts +++ b/services/apps/alcs/src/alcs/planning-review/planning-review-meeting/planning-review-meeting.service.ts @@ -106,9 +106,9 @@ export class PlanningReviewMeetingService { .addSelect( ` CASE - WHEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE) THEN meeting.date END) is NOT NULL - THEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE) THEN meeting.date END) - ELSE MAX(CASE WHEN meeting.date < (CURRENT_DATE) THEN meeting.date END) + WHEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) is NOT NULL + THEN MIN(CASE WHEN meeting.date >= (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) + ELSE MAX(CASE WHEN meeting.date < (CURRENT_DATE AT TIME ZONE \'America/Vancouver\') THEN meeting.date END) END `, 'next_meeting',