mirror of
https://github.com/jwetzell/itsfiveoclockwhere.git
synced 2026-09-01 20:28:57 +00:00
Initial Commit
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
|||||||
|
# Specifies intentionally untracked files to ignore when using Git
|
||||||
|
# http://git-scm.com/docs/gitignore
|
||||||
|
|
||||||
|
*~
|
||||||
|
*.sw[mnpcod]
|
||||||
|
.tmp
|
||||||
|
*.tmp
|
||||||
|
*.tmp.*
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
UserInterfaceState.xcuserstate
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
*.log
|
||||||
|
log.txt
|
||||||
|
npm-debug.log*
|
||||||
|
|
||||||
|
/.idea
|
||||||
|
/.ionic
|
||||||
|
/.sass-cache
|
||||||
|
/.sourcemaps
|
||||||
|
/.versions
|
||||||
|
/.vscode
|
||||||
|
/coverage
|
||||||
|
/dist
|
||||||
|
/node_modules
|
||||||
+118
@@ -0,0 +1,118 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"itsfiveoclockwhere": {
|
||||||
|
"projectType": "application",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"style": "scss"
|
||||||
|
},
|
||||||
|
"@schematics/angular:application": {
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"prefix": "app",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/itsfiveoclockwhere",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"main": "src/main.ts",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "tsconfig.app.json",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"assets": [
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/assets"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "500kb",
|
||||||
|
"maximumError": "1mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "2kb",
|
||||||
|
"maximumError": "4kb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"namedChunks": false,
|
||||||
|
"aot": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"buildOptimizer": false,
|
||||||
|
"optimization": false,
|
||||||
|
"vendorChunk": true,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"sourceMap": true,
|
||||||
|
"namedChunks": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "production"
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "itsfiveoclockwhere:build:production"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"browserTarget": "itsfiveoclockwhere:build:development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "development"
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "itsfiveoclockwhere:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "src/test.ts",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "tsconfig.spec.json",
|
||||||
|
"karmaConfig": "karma.conf.js",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"assets": [
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/assets"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultProject": "itsfiveoclockwhere"
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// Karma configuration file, see link for more information
|
||||||
|
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||||
|
|
||||||
|
module.exports = function (config) {
|
||||||
|
config.set({
|
||||||
|
basePath: '',
|
||||||
|
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||||
|
plugins: [
|
||||||
|
require('karma-jasmine'),
|
||||||
|
require('karma-chrome-launcher'),
|
||||||
|
require('karma-jasmine-html-reporter'),
|
||||||
|
require('karma-coverage'),
|
||||||
|
require('@angular-devkit/build-angular/plugins/karma')
|
||||||
|
],
|
||||||
|
client: {
|
||||||
|
jasmine: {
|
||||||
|
// you can add configuration options for Jasmine here
|
||||||
|
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
||||||
|
// for example, you can disable the random execution with `random: false`
|
||||||
|
// or set a specific seed with `seed: 4321`
|
||||||
|
},
|
||||||
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
|
},
|
||||||
|
jasmineHtmlReporter: {
|
||||||
|
suppressAll: true // removes the duplicated traces
|
||||||
|
},
|
||||||
|
coverageReporter: {
|
||||||
|
dir: require('path').join(__dirname, './coverage/itsfiveoclockwhere'),
|
||||||
|
subdir: '.',
|
||||||
|
reporters: [
|
||||||
|
{ type: 'html' },
|
||||||
|
{ type: 'text-summary' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
reporters: ['progress', 'kjhtml'],
|
||||||
|
port: 9876,
|
||||||
|
colors: true,
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
autoWatch: true,
|
||||||
|
browsers: ['Chrome'],
|
||||||
|
singleRun: false,
|
||||||
|
restartOnFileChange: true
|
||||||
|
});
|
||||||
|
};
|
||||||
Generated
+21925
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "itsfiveoclockwhere",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"scripts": {
|
||||||
|
"ng": "ng",
|
||||||
|
"start": "ng serve",
|
||||||
|
"build": "ng build",
|
||||||
|
"watch": "ng build --watch --configuration development",
|
||||||
|
"test": "ng test"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/animations": "~13.0.0",
|
||||||
|
"@angular/common": "~13.0.0",
|
||||||
|
"@angular/compiler": "~13.0.0",
|
||||||
|
"@angular/core": "~13.0.0",
|
||||||
|
"@angular/forms": "~13.0.0",
|
||||||
|
"@angular/platform-browser": "~13.0.0",
|
||||||
|
"@angular/platform-browser-dynamic": "~13.0.0",
|
||||||
|
"@angular/router": "~13.0.0",
|
||||||
|
"rxjs": "~7.4.0",
|
||||||
|
"tslib": "^2.3.0",
|
||||||
|
"zone.js": "~0.11.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular-devkit/build-angular": "~13.0.2",
|
||||||
|
"@angular/cli": "~13.0.2",
|
||||||
|
"@angular/compiler-cli": "~13.0.0",
|
||||||
|
"@types/jasmine": "~3.10.0",
|
||||||
|
"@types/node": "^12.11.1",
|
||||||
|
"jasmine-core": "~3.10.0",
|
||||||
|
"karma": "~6.3.0",
|
||||||
|
"karma-chrome-launcher": "~3.1.0",
|
||||||
|
"karma-coverage": "~2.0.3",
|
||||||
|
"karma-jasmine": "~4.0.0",
|
||||||
|
"karma-jasmine-html-reporter": "~1.7.0",
|
||||||
|
"typescript": "~4.4.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<div *ngIf="fiveOclock" class="container">
|
||||||
|
<h1 class="timezone">{{fiveOclock.timezone}}</h1>
|
||||||
|
<h2 class="time">{{fiveOclock.date | date:'mediumTime'}}</h2>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
.container {
|
||||||
|
display:flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
background: #2e2e2e;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timezone {
|
||||||
|
font-family: "Open Sans", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
color: whitesmoke
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
font-family: "Open Sans", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
color: whitesmoke
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
|
describe('AppComponent', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [
|
||||||
|
AppComponent
|
||||||
|
],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create the app', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should have as title 'itsfiveoclockwhere'`, () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app.title).toEqual('itsfiveoclockwhere');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render title', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
fixture.detectChanges();
|
||||||
|
const compiled = fixture.nativeElement as HTMLElement;
|
||||||
|
expect(compiled.querySelector('.content span')?.textContent).toContain('itsfiveoclockwhere app is running!');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { formatDate } from '@angular/common';
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { interval, Observable } from 'rxjs';
|
||||||
|
import { TimezoneService } from './services/timezone.service';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
styleUrls: ['./app.component.scss']
|
||||||
|
})
|
||||||
|
export class AppComponent {
|
||||||
|
title = 'itsfiveoclockwhere';
|
||||||
|
|
||||||
|
dates: any[] = []
|
||||||
|
|
||||||
|
fiveOclock: any;
|
||||||
|
second: Observable<number>;
|
||||||
|
|
||||||
|
constructor(private timezoneService: TimezoneService){
|
||||||
|
this.second = interval(1000)
|
||||||
|
|
||||||
|
this.second.subscribe(()=>{
|
||||||
|
this.timezoneService.getCurrentTimeInTimezones(this.timezoneService.getTimezones()).forEach((dateObj)=>{
|
||||||
|
if(dateObj.date.getHours() == 17){
|
||||||
|
this.fiveOclock = dateObj;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
import { TimezoneService } from './services/timezone.service';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
AppComponent
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
],
|
||||||
|
providers: [TimezoneService],
|
||||||
|
bootstrap: [AppComponent]
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { TimezoneService } from './timezone.service';
|
||||||
|
|
||||||
|
describe('TimezoneService', () => {
|
||||||
|
let service: TimezoneService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(TimezoneService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,391 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class TimezoneService {
|
||||||
|
|
||||||
|
// found at have not done any research as to it's completeness https://stackoverflow.com/questions/38399465/how-to-get-list-of-all-timezones-in-javascript
|
||||||
|
timezones: string[] = [
|
||||||
|
'Europe/Andorra',
|
||||||
|
'Asia/Dubai',
|
||||||
|
'Asia/Kabul',
|
||||||
|
'Europe/Tirane',
|
||||||
|
'Asia/Yerevan',
|
||||||
|
'Antarctica/Casey',
|
||||||
|
'Antarctica/Davis',
|
||||||
|
'Antarctica/DumontDUrville', // https://bugs.chromium.org/p/chromium/issues/detail?id=928068
|
||||||
|
'Antarctica/Mawson',
|
||||||
|
'Antarctica/Palmer',
|
||||||
|
'Antarctica/Rothera',
|
||||||
|
'Antarctica/Syowa',
|
||||||
|
'Antarctica/Troll',
|
||||||
|
'Antarctica/Vostok',
|
||||||
|
'America/Argentina/Buenos_Aires',
|
||||||
|
'America/Argentina/Cordoba',
|
||||||
|
'America/Argentina/Salta',
|
||||||
|
'America/Argentina/Jujuy',
|
||||||
|
'America/Argentina/Tucuman',
|
||||||
|
'America/Argentina/Catamarca',
|
||||||
|
'America/Argentina/La_Rioja',
|
||||||
|
'America/Argentina/San_Juan',
|
||||||
|
'America/Argentina/Mendoza',
|
||||||
|
'America/Argentina/San_Luis',
|
||||||
|
'America/Argentina/Rio_Gallegos',
|
||||||
|
'America/Argentina/Ushuaia',
|
||||||
|
'Pacific/Pago_Pago',
|
||||||
|
'Europe/Vienna',
|
||||||
|
'Australia/Lord_Howe',
|
||||||
|
'Antarctica/Macquarie',
|
||||||
|
'Australia/Hobart',
|
||||||
|
'Australia/Currie',
|
||||||
|
'Australia/Melbourne',
|
||||||
|
'Australia/Sydney',
|
||||||
|
'Australia/Broken_Hill',
|
||||||
|
'Australia/Brisbane',
|
||||||
|
'Australia/Lindeman',
|
||||||
|
'Australia/Adelaide',
|
||||||
|
'Australia/Darwin',
|
||||||
|
'Australia/Perth',
|
||||||
|
'Australia/Eucla',
|
||||||
|
'Asia/Baku',
|
||||||
|
'America/Barbados',
|
||||||
|
'Asia/Dhaka',
|
||||||
|
'Europe/Brussels',
|
||||||
|
'Europe/Sofia',
|
||||||
|
'Atlantic/Bermuda',
|
||||||
|
'Asia/Brunei',
|
||||||
|
'America/La_Paz',
|
||||||
|
'America/Noronha',
|
||||||
|
'America/Belem',
|
||||||
|
'America/Fortaleza',
|
||||||
|
'America/Recife',
|
||||||
|
'America/Araguaina',
|
||||||
|
'America/Maceio',
|
||||||
|
'America/Bahia',
|
||||||
|
'America/Sao_Paulo',
|
||||||
|
'America/Campo_Grande',
|
||||||
|
'America/Cuiaba',
|
||||||
|
'America/Santarem',
|
||||||
|
'America/Porto_Velho',
|
||||||
|
'America/Boa_Vista',
|
||||||
|
'America/Manaus',
|
||||||
|
'America/Eirunepe',
|
||||||
|
'America/Rio_Branco',
|
||||||
|
'America/Nassau',
|
||||||
|
'Asia/Thimphu',
|
||||||
|
'Europe/Minsk',
|
||||||
|
'America/Belize',
|
||||||
|
'America/St_Johns',
|
||||||
|
'America/Halifax',
|
||||||
|
'America/Glace_Bay',
|
||||||
|
'America/Moncton',
|
||||||
|
'America/Goose_Bay',
|
||||||
|
'America/Blanc-Sablon',
|
||||||
|
'America/Toronto',
|
||||||
|
'America/Nipigon',
|
||||||
|
'America/Thunder_Bay',
|
||||||
|
'America/Iqaluit',
|
||||||
|
'America/Pangnirtung',
|
||||||
|
'America/Atikokan',
|
||||||
|
'America/Winnipeg',
|
||||||
|
'America/Rainy_River',
|
||||||
|
'America/Resolute',
|
||||||
|
'America/Rankin_Inlet',
|
||||||
|
'America/Regina',
|
||||||
|
'America/Swift_Current',
|
||||||
|
'America/Edmonton',
|
||||||
|
'America/Cambridge_Bay',
|
||||||
|
'America/Yellowknife',
|
||||||
|
'America/Inuvik',
|
||||||
|
'America/Creston',
|
||||||
|
'America/Dawson_Creek',
|
||||||
|
'America/Fort_Nelson',
|
||||||
|
'America/Vancouver',
|
||||||
|
'America/Whitehorse',
|
||||||
|
'America/Dawson',
|
||||||
|
'Indian/Cocos',
|
||||||
|
'Europe/Zurich',
|
||||||
|
'Africa/Abidjan',
|
||||||
|
'Pacific/Rarotonga',
|
||||||
|
'America/Santiago',
|
||||||
|
'America/Punta_Arenas',
|
||||||
|
'Pacific/Easter',
|
||||||
|
'Asia/Shanghai',
|
||||||
|
'Asia/Urumqi',
|
||||||
|
'America/Bogota',
|
||||||
|
'America/Costa_Rica',
|
||||||
|
'America/Havana',
|
||||||
|
'Atlantic/Cape_Verde',
|
||||||
|
'America/Curacao',
|
||||||
|
'Indian/Christmas',
|
||||||
|
'Asia/Nicosia',
|
||||||
|
'Asia/Famagusta',
|
||||||
|
'Europe/Prague',
|
||||||
|
'Europe/Berlin',
|
||||||
|
'Europe/Copenhagen',
|
||||||
|
'America/Santo_Domingo',
|
||||||
|
'Africa/Algiers',
|
||||||
|
'America/Guayaquil',
|
||||||
|
'Pacific/Galapagos',
|
||||||
|
'Europe/Tallinn',
|
||||||
|
'Africa/Cairo',
|
||||||
|
'Africa/El_Aaiun',
|
||||||
|
'Europe/Madrid',
|
||||||
|
'Africa/Ceuta',
|
||||||
|
'Atlantic/Canary',
|
||||||
|
'Europe/Helsinki',
|
||||||
|
'Pacific/Fiji',
|
||||||
|
'Atlantic/Stanley',
|
||||||
|
'Pacific/Chuuk',
|
||||||
|
'Pacific/Pohnpei',
|
||||||
|
'Pacific/Kosrae',
|
||||||
|
'Atlantic/Faroe',
|
||||||
|
'Europe/Paris',
|
||||||
|
'Europe/London',
|
||||||
|
'Asia/Tbilisi',
|
||||||
|
'America/Cayenne',
|
||||||
|
'Africa/Accra',
|
||||||
|
'Europe/Gibraltar',
|
||||||
|
'America/Godthab',
|
||||||
|
'America/Danmarkshavn',
|
||||||
|
'America/Scoresbysund',
|
||||||
|
'America/Thule',
|
||||||
|
'Europe/Athens',
|
||||||
|
'Atlantic/South_Georgia',
|
||||||
|
'America/Guatemala',
|
||||||
|
'Pacific/Guam',
|
||||||
|
'Africa/Bissau',
|
||||||
|
'America/Guyana',
|
||||||
|
'Asia/Hong_Kong',
|
||||||
|
'America/Tegucigalpa',
|
||||||
|
'America/Port-au-Prince',
|
||||||
|
'Europe/Budapest',
|
||||||
|
'Asia/Jakarta',
|
||||||
|
'Asia/Pontianak',
|
||||||
|
'Asia/Makassar',
|
||||||
|
'Asia/Jayapura',
|
||||||
|
'Europe/Dublin',
|
||||||
|
'Asia/Jerusalem',
|
||||||
|
'Asia/Kolkata',
|
||||||
|
'Indian/Chagos',
|
||||||
|
'Asia/Baghdad',
|
||||||
|
'Asia/Tehran',
|
||||||
|
'Atlantic/Reykjavik',
|
||||||
|
'Europe/Rome',
|
||||||
|
'America/Jamaica',
|
||||||
|
'Asia/Amman',
|
||||||
|
'Asia/Tokyo',
|
||||||
|
'Africa/Nairobi',
|
||||||
|
'Asia/Bishkek',
|
||||||
|
'Pacific/Tarawa',
|
||||||
|
'Pacific/Enderbury',
|
||||||
|
'Pacific/Kiritimati',
|
||||||
|
'Asia/Pyongyang',
|
||||||
|
'Asia/Seoul',
|
||||||
|
'Asia/Almaty',
|
||||||
|
'Asia/Qyzylorda',
|
||||||
|
'Asia/Qostanay', // https://bugs.chromium.org/p/chromium/issues/detail?id=928068
|
||||||
|
'Asia/Aqtobe',
|
||||||
|
'Asia/Aqtau',
|
||||||
|
'Asia/Atyrau',
|
||||||
|
'Asia/Oral',
|
||||||
|
'Asia/Beirut',
|
||||||
|
'Asia/Colombo',
|
||||||
|
'Africa/Monrovia',
|
||||||
|
'Europe/Vilnius',
|
||||||
|
'Europe/Luxembourg',
|
||||||
|
'Europe/Riga',
|
||||||
|
'Africa/Tripoli',
|
||||||
|
'Africa/Casablanca',
|
||||||
|
'Europe/Monaco',
|
||||||
|
'Europe/Chisinau',
|
||||||
|
'Pacific/Majuro',
|
||||||
|
'Pacific/Kwajalein',
|
||||||
|
'Asia/Yangon',
|
||||||
|
'Asia/Ulaanbaatar',
|
||||||
|
'Asia/Hovd',
|
||||||
|
'Asia/Choibalsan',
|
||||||
|
'Asia/Macau',
|
||||||
|
'America/Martinique',
|
||||||
|
'Europe/Malta',
|
||||||
|
'Indian/Mauritius',
|
||||||
|
'Indian/Maldives',
|
||||||
|
'America/Mexico_City',
|
||||||
|
'America/Cancun',
|
||||||
|
'America/Merida',
|
||||||
|
'America/Monterrey',
|
||||||
|
'America/Matamoros',
|
||||||
|
'America/Mazatlan',
|
||||||
|
'America/Chihuahua',
|
||||||
|
'America/Ojinaga',
|
||||||
|
'America/Hermosillo',
|
||||||
|
'America/Tijuana',
|
||||||
|
'America/Bahia_Banderas',
|
||||||
|
'Asia/Kuala_Lumpur',
|
||||||
|
'Asia/Kuching',
|
||||||
|
'Africa/Maputo',
|
||||||
|
'Africa/Windhoek',
|
||||||
|
'Pacific/Noumea',
|
||||||
|
'Pacific/Norfolk',
|
||||||
|
'Africa/Lagos',
|
||||||
|
'America/Managua',
|
||||||
|
'Europe/Amsterdam',
|
||||||
|
'Europe/Oslo',
|
||||||
|
'Asia/Kathmandu',
|
||||||
|
'Pacific/Nauru',
|
||||||
|
'Pacific/Niue',
|
||||||
|
'Pacific/Auckland',
|
||||||
|
'Pacific/Chatham',
|
||||||
|
'America/Panama',
|
||||||
|
'America/Lima',
|
||||||
|
'Pacific/Tahiti',
|
||||||
|
'Pacific/Marquesas',
|
||||||
|
'Pacific/Gambier',
|
||||||
|
'Pacific/Port_Moresby',
|
||||||
|
'Pacific/Bougainville',
|
||||||
|
'Asia/Manila',
|
||||||
|
'Asia/Karachi',
|
||||||
|
'Europe/Warsaw',
|
||||||
|
'America/Miquelon',
|
||||||
|
'Pacific/Pitcairn',
|
||||||
|
'America/Puerto_Rico',
|
||||||
|
'Asia/Gaza',
|
||||||
|
'Asia/Hebron',
|
||||||
|
'Europe/Lisbon',
|
||||||
|
'Atlantic/Madeira',
|
||||||
|
'Atlantic/Azores',
|
||||||
|
'Pacific/Palau',
|
||||||
|
'America/Asuncion',
|
||||||
|
'Asia/Qatar',
|
||||||
|
'Indian/Reunion',
|
||||||
|
'Europe/Bucharest',
|
||||||
|
'Europe/Belgrade',
|
||||||
|
'Europe/Kaliningrad',
|
||||||
|
'Europe/Moscow',
|
||||||
|
'Europe/Simferopol',
|
||||||
|
'Europe/Kirov',
|
||||||
|
'Europe/Astrakhan',
|
||||||
|
'Europe/Volgograd',
|
||||||
|
'Europe/Saratov',
|
||||||
|
'Europe/Ulyanovsk',
|
||||||
|
'Europe/Samara',
|
||||||
|
'Asia/Yekaterinburg',
|
||||||
|
'Asia/Omsk',
|
||||||
|
'Asia/Novosibirsk',
|
||||||
|
'Asia/Barnaul',
|
||||||
|
'Asia/Tomsk',
|
||||||
|
'Asia/Novokuznetsk',
|
||||||
|
'Asia/Krasnoyarsk',
|
||||||
|
'Asia/Irkutsk',
|
||||||
|
'Asia/Chita',
|
||||||
|
'Asia/Yakutsk',
|
||||||
|
'Asia/Khandyga',
|
||||||
|
'Asia/Vladivostok',
|
||||||
|
'Asia/Ust-Nera',
|
||||||
|
'Asia/Magadan',
|
||||||
|
'Asia/Sakhalin',
|
||||||
|
'Asia/Srednekolymsk',
|
||||||
|
'Asia/Kamchatka',
|
||||||
|
'Asia/Anadyr',
|
||||||
|
'Asia/Riyadh',
|
||||||
|
'Pacific/Guadalcanal',
|
||||||
|
'Indian/Mahe',
|
||||||
|
'Africa/Khartoum',
|
||||||
|
'Europe/Stockholm',
|
||||||
|
'Asia/Singapore',
|
||||||
|
'America/Paramaribo',
|
||||||
|
'Africa/Juba',
|
||||||
|
'Africa/Sao_Tome',
|
||||||
|
'America/El_Salvador',
|
||||||
|
'Asia/Damascus',
|
||||||
|
'America/Grand_Turk',
|
||||||
|
'Africa/Ndjamena',
|
||||||
|
'Indian/Kerguelen',
|
||||||
|
'Asia/Bangkok',
|
||||||
|
'Asia/Dushanbe',
|
||||||
|
'Pacific/Fakaofo',
|
||||||
|
'Asia/Dili',
|
||||||
|
'Asia/Ashgabat',
|
||||||
|
'Africa/Tunis',
|
||||||
|
'Pacific/Tongatapu',
|
||||||
|
'Europe/Istanbul',
|
||||||
|
'America/Port_of_Spain',
|
||||||
|
'Pacific/Funafuti',
|
||||||
|
'Asia/Taipei',
|
||||||
|
'Europe/Kiev',
|
||||||
|
'Europe/Uzhgorod',
|
||||||
|
'Europe/Zaporozhye',
|
||||||
|
'Pacific/Wake',
|
||||||
|
'America/New_York',
|
||||||
|
'America/Detroit',
|
||||||
|
'America/Kentucky/Louisville',
|
||||||
|
'America/Kentucky/Monticello',
|
||||||
|
'America/Indiana/Indianapolis',
|
||||||
|
'America/Indiana/Vincennes',
|
||||||
|
'America/Indiana/Winamac',
|
||||||
|
'America/Indiana/Marengo',
|
||||||
|
'America/Indiana/Petersburg',
|
||||||
|
'America/Indiana/Vevay',
|
||||||
|
'America/Chicago',
|
||||||
|
'America/Indiana/Tell_City',
|
||||||
|
'America/Indiana/Knox',
|
||||||
|
'America/Menominee',
|
||||||
|
'America/North_Dakota/Center',
|
||||||
|
'America/North_Dakota/New_Salem',
|
||||||
|
'America/North_Dakota/Beulah',
|
||||||
|
'America/Denver',
|
||||||
|
'America/Boise',
|
||||||
|
'America/Phoenix',
|
||||||
|
'America/Los_Angeles',
|
||||||
|
'America/Anchorage',
|
||||||
|
'America/Juneau',
|
||||||
|
'America/Sitka',
|
||||||
|
'America/Metlakatla',
|
||||||
|
'America/Yakutat',
|
||||||
|
'America/Nome',
|
||||||
|
'America/Adak',
|
||||||
|
'Pacific/Honolulu',
|
||||||
|
'America/Montevideo',
|
||||||
|
'Asia/Samarkand',
|
||||||
|
'Asia/Tashkent',
|
||||||
|
'America/Caracas',
|
||||||
|
'Asia/Ho_Chi_Minh',
|
||||||
|
'Pacific/Efate',
|
||||||
|
'Pacific/Wallis',
|
||||||
|
'Pacific/Apia',
|
||||||
|
'Africa/Johannesburg'
|
||||||
|
]
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
public getTimezones() : string[] {
|
||||||
|
return this.timezones
|
||||||
|
}
|
||||||
|
|
||||||
|
public getTimeForTimezone(date: Date, timezone: string) : Date {
|
||||||
|
return new Date(date.toLocaleString("en-US", {timeZone: timezone}));
|
||||||
|
}
|
||||||
|
|
||||||
|
public getCurrentTimeInTimezones(timezones: string[]) : { timezone: string; date: Date; }[] {
|
||||||
|
var now = new Date();
|
||||||
|
var dates: { timezone: string; date: Date; }[] = [];
|
||||||
|
|
||||||
|
this.timezones.forEach(element => {
|
||||||
|
dates.push({ timezone: element, date: this.getTimeForTimezone(now,element)})
|
||||||
|
});
|
||||||
|
|
||||||
|
dates.sort((a,b)=>{
|
||||||
|
if(a.date>b.date){
|
||||||
|
return 1;
|
||||||
|
}else if (a.date<b.date){
|
||||||
|
return -1;
|
||||||
|
}else{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return dates;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export const environment = {
|
||||||
|
production: true
|
||||||
|
};
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// This file can be replaced during build by using the `fileReplacements` array.
|
||||||
|
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
|
||||||
|
// The list of file replacements can be found in `angular.json`.
|
||||||
|
|
||||||
|
export const environment = {
|
||||||
|
production: false
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For easier debugging in development mode, you can import the following file
|
||||||
|
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
||||||
|
*
|
||||||
|
* This import should be commented out in production mode because it will have a negative impact
|
||||||
|
* on performance if an error is thrown.
|
||||||
|
*/
|
||||||
|
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>itsfiveoclockwhere</title>
|
||||||
|
<base href="/">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<!-- <link rel="icon" type="image/x-icon" href="favicon.ico">ng serv -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<app-root></app-root>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||||
|
.catch(err => console.error(err));
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* This file includes polyfills needed by Angular and is loaded before the app.
|
||||||
|
* You can add your own extra polyfills to this file.
|
||||||
|
*
|
||||||
|
* This file is divided into 2 sections:
|
||||||
|
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
||||||
|
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
||||||
|
* file.
|
||||||
|
*
|
||||||
|
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
||||||
|
* automatically update themselves. This includes recent versions of Safari, Chrome (including
|
||||||
|
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
|
||||||
|
*
|
||||||
|
* Learn more in https://angular.io/guide/browser-support
|
||||||
|
*/
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* BROWSER POLYFILLS
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||||
|
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||||||
|
* because those flags need to be set before `zone.js` being loaded, and webpack
|
||||||
|
* will put import in the top of bundle, so user need to create a separate file
|
||||||
|
* in this directory (for example: zone-flags.ts), and put the following flags
|
||||||
|
* into that file, and then add the following code before importing zone.js.
|
||||||
|
* import './zone-flags';
|
||||||
|
*
|
||||||
|
* The flags allowed in zone-flags.ts are listed here.
|
||||||
|
*
|
||||||
|
* The following flags will work for all browsers.
|
||||||
|
*
|
||||||
|
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
||||||
|
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||||||
|
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
||||||
|
*
|
||||||
|
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||||||
|
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||||||
|
*
|
||||||
|
* (window as any).__Zone_enable_cross_context_check = true;
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* Zone JS is required by default for Angular itself.
|
||||||
|
*/
|
||||||
|
import 'zone.js'; // Included with Angular CLI.
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************************************
|
||||||
|
* APPLICATION IMPORTS
|
||||||
|
*/
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
body {
|
||||||
|
height: 100vh;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||||
|
|
||||||
|
import 'zone.js/testing';
|
||||||
|
import { getTestBed } from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
BrowserDynamicTestingModule,
|
||||||
|
platformBrowserDynamicTesting
|
||||||
|
} from '@angular/platform-browser-dynamic/testing';
|
||||||
|
|
||||||
|
declare const require: {
|
||||||
|
context(path: string, deep?: boolean, filter?: RegExp): {
|
||||||
|
keys(): string[];
|
||||||
|
<T>(id: string): T;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// First, initialize the Angular testing environment.
|
||||||
|
getTestBed().initTestEnvironment(
|
||||||
|
BrowserDynamicTestingModule,
|
||||||
|
platformBrowserDynamicTesting(),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Then we find all the tests.
|
||||||
|
const context = require.context('./', true, /\.spec\.ts$/);
|
||||||
|
// And load the modules.
|
||||||
|
context.keys().map(context);
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/app",
|
||||||
|
"types": []
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/main.ts",
|
||||||
|
"src/polyfills.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||||
|
{
|
||||||
|
"compileOnSave": false,
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "./",
|
||||||
|
"outDir": "./dist/out-tsc",
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"declaration": false,
|
||||||
|
"downlevelIteration": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"importHelpers": true,
|
||||||
|
"target": "es2017",
|
||||||
|
"module": "es2020",
|
||||||
|
"lib": [
|
||||||
|
"es2020",
|
||||||
|
"dom"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
|
"strictInjectionParameters": true,
|
||||||
|
"strictInputAccessModifiers": true,
|
||||||
|
"strictTemplates": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/test.ts",
|
||||||
|
"src/polyfills.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user