# ngy-time-picker

> A simple time picker for angular (Dynamic time format). Supported for Template driven and Reactive-form

Latest version **2.1.1** (published 2021-03-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngy-time-picker
pnpm add ngy-time-picker
yarn add ngy-time-picker
bun add ngy-time-picker
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-03-28 |
| First published | 2020-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 321.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yaseer Munas |
| Maintainers | yaseerm |
| Keywords | angular, typescript, javascript, time picker, angular time picker, time |

## Links

- npm: https://www.npmjs.com/package/ngy-time-picker
- Repository: https://github.com/Yaseern/TimePickerLibrary
- Issues: https://github.com/Yaseern/TimePickerLibrary/issues
- npm.io page: https://npm.io/package/ngy-time-picker

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 2.1.1 (latest) — 2021-03-28
- 2.1.0 — 2021-03-28
- 2.0.1 — 2020-10-25
- 2.0.0 — 2020-10-25
- 0.0.2 — 2020-09-21
- 0.0.1 — 2020-09-21

## README

<div align="center">
  <h1>ngy-time-picker</h1>
  <br>
  <h4>A simple time picker for Angular</h4>
</div>

# TimePickerLibrary

DEMO: https://yaseern.github.io/awesomeAngular/time

## Dependencies

- moment js must installed 
```bash
npm install moment
```

Latest version available for all version of Angular

## Install

```bash
npm install ngy-time-picker
```

## Setup

**step 1:** add NgTimePickerModule to app NgModule or import to the shared module

```typescript
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 {}
```

```html
<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

| Option            | Type                           | Default           | Description                                                                                                                                     |
| ----------------- | ------------------------------ | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| ngModel         | input                          |                   | which binds select stores the user value in a variable                                                                                           |
| ngModelChange   | event                          |                   | On Change event when select the option                                                                                                           |
| format        | string                        | HH:mm             | Define the display time format (Ex: HH:mm, hh:mm:A)                                                                                                 |                                                                                                                                          | timeRange        | input                        |              | Define the hour values you want and disable the rest (Ex: disable before 07:30 then the value should apply as timeRange="07:30") 
| isDisabled        | boolean                        | false             | If field disabled then this should set true
| defaultDuration        | number                        | 0             | Define 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](https://github.com/Yaseern) &nbsp;&middot;&nbsp;

---
_Source: https://npm.io/package/ngy-time-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
