@ngodings/ngx-timezone
TypeScript icon, indicating that this package has built-in type declarations

15.0.9 • Public • Published

@ngodings/ngx-timezone

Easy for get All Timezone, detect your timezone, convert timezone to country & get all timezone by country in Angular

Demo - Angular v15

https://npm.ngodings.com/packages/ngx-timezone

Support Me

If you like this package I will be happy that you support me on Buy me a coffee :)
Buy me coffee: https://www.buymeacoffee.com/alidihaw
Indonesia People: https://sociabuzz.com/dihaw

Getting Started

Installing and Importing

Install the package by command:

 npm install @ngodings/ngx-timezone --save

Import the module

import { NgxTimezoneModule, TimezoneService } from "@ngodings/ngx-timezone";

@NgModule({
    imports: [
        ...
        NgxTimezoneModule
    ],
    declarations: [...],
    providers: [
        ...
        TimezoneService
    ]
})
export class AppModule {}

Usage

Import the service

constructor(private timezoneService: TimezoneService,) {}

Your timezone

this.timezoneService.timezone;

Convert Timezone to Country

await this.timezoneService.convertTimezoneToCountry('Asia/Jakarta');

Convert Timezone to Country - Pipe

{{ 'Asia/Jakarta'| timezoneToCountryPipe | async }};

List Timezones from Country

await this.timezoneService.getListTimezoneFromCountry('Indonesia')

List Timezones

await this.timezoneService.getListTimezones()

Development

Prepare your environment

  • Install Node.js and NPM
  • Install local dev dependencies: npm install while current directory is this repo

License

MIT @ Ali Abdul Wahid

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @ngodings/ngx-timezone

    Weekly Downloads

    2

    Version

    15.0.9

    License

    MIT

    Unpacked Size

    40.3 kB

    Total Files

    17

    Last publish

    Collaborators

    • alidihaw