npm

Need private packages and team management tools?Check out npm Orgs. »

moment-timezone-picker

1.0.0 • Public • Published

MomentTimezonePicker

NPM

npm version

Versions

Angular Version
8 1.x.x
7 0.x.x

Dependencies

For select input @ng-select/ng-select For time core moment-timezone

Getting started

Step 1: Install

NPM

npm i moment-timezone-picker --save

Step 2: Import the MomentTimezonePickerModule

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
 
import { AppComponent } from './app.component';
import { MomentTimezonePickerModule } from 'moment-timezone-picker'; //add this
 
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MomentTimezonePickerModule //add this
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Step 3: Add in component html

<ng-moment-timezone-picker (onselect)="yourFunc($event)" 
                            [customPlaceholderText]="yourText">
</ng-moment-timezone-picker>

Step 4: Configuration

Inputs

Input Type Default Required Description
[customPlaceholderText] string Choose... no Allows you to localize the placeholder text.
[getUserZone] boolean false no Allows you to guess user timezone. If true also emits value on init.
[setZone] string null no Allows to set default zone on init. Example America/Los_Angeles.

Outputs

Output Description
(onselect) Returns object with 5 keys (TZone)

Object: TZone

Field Type Example
abbr string GMT
group string Europe
nameValue string Europe/London
timeValue string +00:00
name string Europe/London (+00:00)

Contributor

install

npm i moment-timezone-picker

Downloadsweekly downloads

83

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability