mirror of
https://github.com/jwetzell/itsfiveoclockwhere.git
synced 2026-08-14 03:33:41 +00:00
List of timezones
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { formatDate } from '@angular/common';
|
||||
import { Component } from '@angular/core';
|
||||
import { interval, Observable } from 'rxjs';
|
||||
import { TimezoneService } from './services/timezone.service';
|
||||
import { Timezone } from './timezone/models/timezone.model';
|
||||
import { TimezoneService } from './timezone/services/timezone.service';
|
||||
|
||||
|
||||
|
||||
@@ -15,16 +16,20 @@ export class AppComponent {
|
||||
|
||||
dates: any[] = []
|
||||
|
||||
fiveOclock: any;
|
||||
fiveOclock: Timezone | undefined;
|
||||
second: Observable<number>;
|
||||
|
||||
fiveOclocks: Timezone[] = [];
|
||||
|
||||
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;
|
||||
this.fiveOclocks = [];
|
||||
this.timezoneService.getCurrentTimeInTimezones(this.timezoneService.getTimezones()).forEach((timezoneObj)=>{
|
||||
if(timezoneObj.time?.hour === 17){
|
||||
this.fiveOclock = timezoneObj;
|
||||
this.fiveOclocks.push(timezoneObj);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user