diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a9f7cd1..6512a06 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,4 +12,4 @@ updates: - '@angular*' update-types: - 'minor' - - 'patch' \ No newline at end of file + - 'patch' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7833747..c70e566 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,7 @@ jobs: - name: install dependencies run: npm install - + - name: build run: npm run build diff --git a/angular.json b/angular.json index 0a5164b..ef09a7d 100644 --- a/angular.json +++ b/angular.json @@ -24,18 +24,11 @@ "base": "dist/itsfiveoclockwhere" }, "index": "src/index.html", - "polyfills": [ - "src/polyfills.ts" - ], + "polyfills": ["src/polyfills.ts"], "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.scss" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.scss"], "scripts": [], "browser": "src/main.ts" }, diff --git a/package.json b/package.json index 42c0300..cd8ddc1 100644 --- a/package.json +++ b/package.json @@ -32,4 +32,4 @@ "prettier": "^3.0.3", "typescript": "^5.6.3" } -} \ No newline at end of file +} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7a7c0f4..a9e529f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -6,10 +6,10 @@ import { TimezoneService } from './timezone/services/timezone.service'; declare let gtag: Function; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'], - standalone: false + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + standalone: false, }) export class AppComponent { fiveOclocks: Timezone[] = []; diff --git a/src/app/services/google-analytics.service.ts b/src/app/services/google-analytics.service.ts index 4aa0203..c1e7dc8 100644 --- a/src/app/services/google-analytics.service.ts +++ b/src/app/services/google-analytics.service.ts @@ -3,14 +3,12 @@ import { Injectable } from '@angular/core'; declare let gtag: Function; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class GoogleAnalyticsService { - - constructor() { } + constructor() {} public emitEvent(name: string, event: any) { - gtag('event', name, event) + gtag('event', name, event); } - } diff --git a/src/app/timezone/components/timezone-list/timezone-list.component.ts b/src/app/timezone/components/timezone-list/timezone-list.component.ts index 72fdef7..42a911c 100644 --- a/src/app/timezone/components/timezone-list/timezone-list.component.ts +++ b/src/app/timezone/components/timezone-list/timezone-list.component.ts @@ -3,22 +3,28 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/cor import { Timezone } from '../../models/timezone.model'; @Component({ - selector: 'app-timezone-list', - templateUrl: './timezone-list.component.html', - styleUrls: ['./timezone-list.component.scss'], - animations: [ - trigger('displayState', [ - state('show', style({ - opacity: 1, - })), - state('hide', style({ - opacity: 0, - })), - transition('show=>hide', animate('450ms ease-out')), - transition('hide=>show', animate('450ms ease-in')), - ]), - ], - standalone: false + selector: 'app-timezone-list', + templateUrl: './timezone-list.component.html', + styleUrls: ['./timezone-list.component.scss'], + animations: [ + trigger('displayState', [ + state( + 'show', + style({ + opacity: 1, + }) + ), + state( + 'hide', + style({ + opacity: 0, + }) + ), + transition('show=>hide', animate('450ms ease-out')), + transition('hide=>show', animate('450ms ease-in')), + ]), + ], + standalone: false, }) export class TimezoneListComponent implements OnInit, OnChanges { @Input() timezones: Timezone[] = []; diff --git a/src/app/timezone/services/timezone.service.ts b/src/app/timezone/services/timezone.service.ts index adda204..58310ec 100644 --- a/src/app/timezone/services/timezone.service.ts +++ b/src/app/timezone/services/timezone.service.ts @@ -3,39 +3,36 @@ import { DateTime } from 'luxon'; import { Timezone, TimezoneCompare, TimezoneList } from '../models/timezone.model'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class TimezoneService { + constructor() {} - constructor() { } - - public getCurrentTimezone() : string | null { - return DateTime.now().zoneName + public getCurrentTimezone(): string | null { + return DateTime.now().zoneName; } public getTimezones(): string[] { - return TimezoneList() + return TimezoneList(); } public getCurrentTimeForTimezone(timezone: string): DateTime | null { - - var dateTime = DateTime.local().setZone(timezone) + var dateTime = DateTime.local().setZone(timezone); return dateTime.isValid ? dateTime : null; - } public getCurrentTimeInTimezones(timezones: string[]): Timezone[] { var dates: Timezone[] = []; - timezones.forEach(element => { + timezones.forEach((element) => { var date = this.getCurrentTimeForTimezone(element); if (date != null) { - const timezone = { name: element, time: date } - dates.push(timezone) + const timezone = { name: element, time: date }; + dates.push(timezone); } }); - + return dates.sort(TimezoneCompare); } } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 3612073..c966979 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,3 +1,3 @@ export const environment = { - production: true + production: true, }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index f56ff47..66998ae 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,7 +3,7 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false + production: false, }; /*