New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-google-time-zone

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-google-time-zone

Angular service for Google's Time Zone API.

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
81
decreased by-2.41%
Maintainers
1
Weekly downloads
 
Created
Source

NgxGoogleTimeZone

Angular service for Google's Time Zone API.

w3soto

StackBlitz Demo

Official Google Time Zone API documentation

Installation

npm -i ngx-google-time-zone

Example

For more details see projects/demo application

import { NgxGoogleTimeZoneModule } from "ngx-google-time-zone";
...

@NgModule({
  imports: [
    ...,
    NgxGoogleTimeZoneModule.forRoot({
      apiKey: '---GOOGLE-API-KEY---'
    }),
  ],
  ...
})
class AppModule { ... }

Usage

import { NgxGoogleTimeZoneService } from "ngx-google-time-zone";

@Component({
  ...
})
class AppComponent { 
  
  constructor(
    private _gtz: NgxGoogleTimeZoneService
  ) {}
  
  getTimeZone() {
    this._gtz.getTimeZone({
      lat: 48.743551, 
      lng: 18.914176
    }).subscribe(resp => console.log('TimeZoneResponse:', resp));
  }
  
}

Services

  • NgxGoogleTimeZoneService
getTimeZone(tzReq: TimeZoneRequest): Observable<TimeZoneResponse>

Interfaces

  • TimeZoneRequest
export interface TimeZoneRequest {
  lat: number,
  lng: number,
  timestamp?: number, // in seconds
  language?: string,
  apiKey?: string // if not provided with NgxGoogleTimeZoneModule.forRoot(...)
}
  • TimeZoneResponse
export interface TimeZoneResponse {
  dstOffset: number,
  rawOffset: number,
  status: TimeZoneStatus,
  timeZoneId: string,
  timeZoneName: string,
}
  • TimeZoneStatus
export type TimeZoneStatus = 'OK' | 'ZERO_RESULTS' | 'OVER_DAILY_LIMIT' | 'OVER_QUERY_LIMIT' | 'REQUEST_DENIED' |
  'INVALID_REQUEST' | 'UNKNOWN_ERROR';

Keywords

FAQs

Package last updated on 06 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc