mirror of
https://github.com/jwetzell/itsfiveoclockwhere.git
synced 2026-08-18 13:33:56 +00:00
prettier
This commit is contained in:
+3
-10
@@ -24,18 +24,11 @@
|
|||||||
"base": "dist/itsfiveoclockwhere"
|
"base": "dist/itsfiveoclockwhere"
|
||||||
},
|
},
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"polyfills": [
|
"polyfills": ["src/polyfills.ts"],
|
||||||
"src/polyfills.ts"
|
|
||||||
],
|
|
||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": ["src/favicon.ico", "src/assets"],
|
||||||
"src/favicon.ico",
|
"styles": ["src/styles.scss"],
|
||||||
"src/assets"
|
|
||||||
],
|
|
||||||
"styles": [
|
|
||||||
"src/styles.scss"
|
|
||||||
],
|
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"browser": "src/main.ts"
|
"browser": "src/main.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import { TimezoneService } from './timezone/services/timezone.service';
|
|||||||
|
|
||||||
declare let gtag: Function;
|
declare let gtag: Function;
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: ['./app.component.scss'],
|
styleUrls: ['./app.component.scss'],
|
||||||
standalone: false
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
fiveOclocks: Timezone[] = [];
|
fiveOclocks: Timezone[] = [];
|
||||||
|
|||||||
@@ -3,14 +3,12 @@ import { Injectable } from '@angular/core';
|
|||||||
declare let gtag: Function;
|
declare let gtag: Function;
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class GoogleAnalyticsService {
|
export class GoogleAnalyticsService {
|
||||||
|
constructor() {}
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
public emitEvent(name: string, event: any) {
|
public emitEvent(name: string, event: any) {
|
||||||
gtag('event', name, event)
|
gtag('event', name, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,22 +3,28 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/cor
|
|||||||
import { Timezone } from '../../models/timezone.model';
|
import { Timezone } from '../../models/timezone.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-timezone-list',
|
selector: 'app-timezone-list',
|
||||||
templateUrl: './timezone-list.component.html',
|
templateUrl: './timezone-list.component.html',
|
||||||
styleUrls: ['./timezone-list.component.scss'],
|
styleUrls: ['./timezone-list.component.scss'],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('displayState', [
|
trigger('displayState', [
|
||||||
state('show', style({
|
state(
|
||||||
opacity: 1,
|
'show',
|
||||||
})),
|
style({
|
||||||
state('hide', style({
|
opacity: 1,
|
||||||
opacity: 0,
|
})
|
||||||
})),
|
),
|
||||||
transition('show=>hide', animate('450ms ease-out')),
|
state(
|
||||||
transition('hide=>show', animate('450ms ease-in')),
|
'hide',
|
||||||
]),
|
style({
|
||||||
],
|
opacity: 0,
|
||||||
standalone: false
|
})
|
||||||
|
),
|
||||||
|
transition('show=>hide', animate('450ms ease-out')),
|
||||||
|
transition('hide=>show', animate('450ms ease-in')),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class TimezoneListComponent implements OnInit, OnChanges {
|
export class TimezoneListComponent implements OnInit, OnChanges {
|
||||||
@Input() timezones: Timezone[] = [];
|
@Input() timezones: Timezone[] = [];
|
||||||
|
|||||||
@@ -3,36 +3,33 @@ import { DateTime } from 'luxon';
|
|||||||
import { Timezone, TimezoneCompare, TimezoneList } from '../models/timezone.model';
|
import { Timezone, TimezoneCompare, TimezoneList } from '../models/timezone.model';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class TimezoneService {
|
export class TimezoneService {
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
constructor() { }
|
public getCurrentTimezone(): string | null {
|
||||||
|
return DateTime.now().zoneName;
|
||||||
public getCurrentTimezone() : string | null {
|
|
||||||
return DateTime.now().zoneName
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getTimezones(): string[] {
|
public getTimezones(): string[] {
|
||||||
return TimezoneList()
|
return TimezoneList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCurrentTimeForTimezone(timezone: string): DateTime | null {
|
public getCurrentTimeForTimezone(timezone: string): DateTime | null {
|
||||||
|
var dateTime = DateTime.local().setZone(timezone);
|
||||||
var dateTime = DateTime.local().setZone(timezone)
|
|
||||||
|
|
||||||
return dateTime.isValid ? dateTime : null;
|
return dateTime.isValid ? dateTime : null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCurrentTimeInTimezones(timezones: string[]): Timezone[] {
|
public getCurrentTimeInTimezones(timezones: string[]): Timezone[] {
|
||||||
var dates: Timezone[] = [];
|
var dates: Timezone[] = [];
|
||||||
|
|
||||||
timezones.forEach(element => {
|
timezones.forEach((element) => {
|
||||||
var date = this.getCurrentTimeForTimezone(element);
|
var date = this.getCurrentTimeForTimezone(element);
|
||||||
if (date != null) {
|
if (date != null) {
|
||||||
const timezone = { name: element, time: date }
|
const timezone = { name: element, time: date };
|
||||||
dates.push(timezone)
|
dates.push(timezone);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: true
|
production: true,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// The list of file replacements can be found in `angular.json`.
|
// The list of file replacements can be found in `angular.json`.
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false
|
production: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user