From cb2a10495f99ff3f1e82831d89f766e9b37fe278 Mon Sep 17 00:00:00 2001 From: atlinx Date: Wed, 27 Nov 2024 11:26:35 -0500 Subject: [PATCH] Fix timer on safari --- .../scarlet-game-jam/scarlet-game-jam-page.component.ts | 4 ++-- .../scarlet-showcase/scarlet-showcase-page.component.ts | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/pages/scarlet-game-jam/scarlet-game-jam/scarlet-game-jam-page.component.ts b/src/app/pages/scarlet-game-jam/scarlet-game-jam/scarlet-game-jam-page.component.ts index 31028b4..cf537e4 100644 --- a/src/app/pages/scarlet-game-jam/scarlet-game-jam/scarlet-game-jam-page.component.ts +++ b/src/app/pages/scarlet-game-jam/scarlet-game-jam/scarlet-game-jam-page.component.ts @@ -34,8 +34,8 @@ export class ScarletGameJamPageComponent implements OnInit { getSemesterString = getSemesterString; ngOnInit(): void { - let startDateTimeStart = convertHourMinute12to24(this.startDateTime.split('-')[0]); - let startDateObj = new Date(this.startDate + ', ' + new Date().getFullYear() + ' ' + startDateTimeStart + ' EST'); + let startDateTime24Hr = convertHourMinute12to24(this.startDateTime.split('-')[0]); + let startDateObj = new Date(this.startDate + ', ' + new Date().getFullYear() + ' ' + startDateTime24Hr + ' EST'); this.eventActive = startDateObj < new Date(); let finalDateSeconds = startDateObj.getTime() / 1000; diff --git a/src/app/pages/scarlet-showcase/scarlet-showcase/scarlet-showcase-page.component.ts b/src/app/pages/scarlet-showcase/scarlet-showcase/scarlet-showcase-page.component.ts index b2757e2..8214d76 100644 --- a/src/app/pages/scarlet-showcase/scarlet-showcase/scarlet-showcase-page.component.ts +++ b/src/app/pages/scarlet-showcase/scarlet-showcase/scarlet-showcase-page.component.ts @@ -1,6 +1,6 @@ import { AfterViewInit, Component } from '@angular/core'; import { BreakpointManagerService } from '@app/services/breakpoint-manager.service'; -import { getSemesterString } from '@src/app/utils/duration-utils'; +import { convertHourMinute12to24, getSemesterString } from '@src/app/utils/duration-utils'; import { SettingsService } from '@src/_settings'; declare var FlipDown: any; @@ -14,7 +14,7 @@ declare var FlipDown: any; }) export class ScarletShowcasePageComponent implements AfterViewInit { startDate: string = 'Dec 8'; - startTime: string = '5pm'; + startTime: string = '5:00 pm'; eventActive: boolean = false; @@ -25,9 +25,11 @@ export class ScarletShowcasePageComponent implements AfterViewInit { getSemesterString = getSemesterString; ngAfterViewInit(): void { + let startTime24Hr = convertHourMinute12to24(this.startTime); if (!this.eventActive) { var finalDateSeconds = - new Date(this.startDate + ', ' + new Date().getFullYear() + ' ' + this.startTime + ' EST').getTime() / 1000; + new Date(this.startDate + ', ' + new Date().getFullYear() + ' ' + startTime24Hr + ' EST').getTime() / 1000; + console.log('using file seconds: ', finalDateSeconds); var flipdown = new FlipDown(finalDateSeconds, 'sgj-countdown', { theme: 'dark', }).start();