npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-time-duration-picker

v2.0.3

Published

A generic time duration picker Angular 2+ component

Downloads

354

Readme

npm version

ngx-time-duration-picker

A generic time duration picker Angular component (v. 2.0.0+)

Installation

To install this library, run:

$ npm install ngx-time-duration-picker --save

Requirements

usage

Import the NgxTimeDurationPickerModule in your app.module and add it to the imports array. You need to import the Angular FormsModule and ReactiveFormsModule as well. and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import the library
import { NgxTimeDurationPickerModule } from 'angular2-time-duration-picker';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ...
    NgxTimeDurationPickerModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once your library is imported, you can use its components in your Angular application:

Add the ngx-time-duration-picker component to the page where you want to use the picker, with disired Time unit ngx-time-duration-picker-unit.

<time-duration-picker [inputDisabled]=false returnedValueUnit="second" (onChange)="onNumberChanged($event)" class="row">
  <time-duration-picker-unit class="col-md-12" [name]="'second'"></time-duration-picker-unit>
</time-duration-picker>
<ngx-time-duration-picker returnedValueUnit="hour" (OnChange)="onValueChanged($event)">
  <ngx-time-duration-picker-unit name="millisecond" min="0" max="999" step="1"></ngx-time-duration-picker-unit>
  <ngx-time-duration-picker-unit name="second" min="0" max="60" step="1"></ngx-time-duration-picker-unit>
  <ngx-time-duration-picker-unit name="minute" min="0" max="60" step="1"></ngx-time-duration-picker-unit>
  <ngx-time-duration-picker-unit name="hour" min="0" max="60" step="1"></ngx-time-duration-picker-unit>
  <ngx-time-duration-picker-unit name="day" min="0" max="60" step="1"></ngx-time-duration-picker-unit>
  <ngx-time-duration-picker-unit name="week" min="0" max="60" step="1"></ngx-time-duration-picker-unit>
</ngx-time-duration-picker>

time-duration-picker Field Schema

| Attribute | Type | Required | Description | | :------------- |:-------------| :-----:| :-----| | returnedValueUnit | [input] String | No | The unit of returned Value. default: 'second' | | inputDisabled | [input] Boolean | No | Defines if the input input should be disabled / editable by the user. default: true | | OnChange | (output) Number | No | The onChange event of the component. Emits the value of the picker every time the user has clicked the - or + button. |

time-duration-picker-unit Field Schema

| Attribute | Type | Required | Description | | :------------- |:-------------| :-----:| :-----| | name | [input] String | Yes | The units of the picker, supported values: 'week', 'day', 'hour', 'minute', 'second' and 'millisecond' | | label | [input] String | No | The label of the picker, default: name capitalized | | min | [input] number | No | The Minimum value can be set, default: 0 | | max | [input] number | No | The Maximum value can be set, default: (check the code) | | step | [input] number | No | The step value, default: 1 | | inputDisabled | [input] Boolean | No | Defines if the input input should be disabled / editable by the user. default: true | | OnChange | (output) Number | No | The onChange event of the component. Emits the value of the picker every time the user has clicked the - or + button. |

License

MIT © Mohammad Nuairat