2.1.1 • Published 3 years ago

ngy-time-picker v2.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

TimePickerLibrary

DEMO: https://yaseern.github.io/awesomeAngular/time

Dependencies

  • moment js must installed
npm install moment

Latest version available for all version of Angular

Install

npm install ngy-time-picker

Setup

step 1: add NgTimePickerModule to app NgModule or import to the shared module

import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { NgTimePickerModule } from 'ngy-time-picker';

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    NgTimePickerModule// NgTimePickerModule added
  ],
  bootstrap: [AppComponent],
  declarations: [AppComponent]
})
class AppModule {}
<ng-time-picker [(ngModel)]="example1" (ngModelChange)="onChangeDoSomething1()"></ng-time-picker>

<ng-time-picker [(ngModel)]="example2" (ngModelChange)="onChangeDoSomething2()" [isDisabled]="true"></ng-time-picker> <!--08:45-->

<ng-time-picker [(ngModel)]="example3" [timeRange]="08:45"></ng-time-picker> 

<ng-time-picker [(ngModel)]="example4" [timeRange]="example2" [defaultDuration]="0.5"></ng-time-picker> <!-- default time will be set when change the example2 : 09:15-->

Options

OptionTypeDefaultDescription
ngModelinputwhich binds select stores the user value in a variable
ngModelChangeeventOn Change event when select the option
formatstringHH:mmDefine the display time format (Ex: HH:mm, hh:mm:A)timeRangeinputDefine the hour values you want and disable the rest (Ex: disable before 07:30 then the value should apply as timeRange="07:30")
isDisabledbooleanfalseIf field disabled then this should set true
defaultDurationnumber0Define for default range between two times (Ex: If start time set as 08:45 then end time should auto reflect after specified duration, the duration is 30 minutes, end time will be 09:15) - number should be in hour format

License

MIT


GitHub @Yaseern  · 

2.1.1

3 years ago

2.1.0

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago