# ng-ts-datepicker

> [![Build Status](https://travis-ci.org/amphinicy/ng-ts-datepicker.svg?branch=master)](https://travis-ci.org/amphinicy/ng-ts-datepicker)

Latest version **1.3.0** (published 2019-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-ts-datepicker
pnpm add ng-ts-datepicker
yarn add ng-ts-datepicker
bun add ng-ts-datepicker
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2019-07-05 |
| First published | 2018-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 118.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Amphinicy Technologies |
| Maintainers | slatomac, slavede |

## Links

- npm: https://www.npmjs.com/package/ng-ts-datepicker
- Repository: https://github.com/amphinicy/ng-ts-datepicker
- Issues: https://github.com/amphinicy/ng-ts-datepicker/issues
- npm.io page: https://npm.io/package/ng-ts-datepicker

## Dependencies (1)

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

## Recent versions

- 1.3.0 (latest) — 2019-07-05
- 1.2.0 — 2018-02-07
- 1.1.3 — 2018-02-06
- 1.1.2 — 2018-01-31
- 1.1.1 — 2018-01-29
- 1.1.0 — 2018-01-29
- 1.0.0 — 2018-01-29
- 0.9.3 — 2018-01-29
- 0.9.2 — 2018-01-29
- 0.9.0 — 2018-01-26
- 0.0.5 — 2018-01-26
- 0.0.4 — 2018-01-26
- 0.0.3 — 2018-01-26
- 0.0.2 — 2018-01-26
- 0.0.1 — 2018-01-26

## README

[![Build Status](https://travis-ci.org/amphinicy/ng-ts-datepicker.svg?branch=master)](https://travis-ci.org/amphinicy/ng-ts-datepicker)

# NgTsDatepicker

Angular (6+) directive which wraps http://eonasdan.github.io/bootstrap-datetimepicker/ component.

![image](https://user-images.githubusercontent.com/2838038/35628522-73da393c-069c-11e8-953d-0bbc3b6ac785.png)

## Installation

`npm install ng-ts-datepicker --save`

## Usage

### Import module

```ts
import { NgTsDatepickerModule } from 'ng-ts-datepicker';
. . .
@NgModule({
  . . .
  imports : [
    . . .
    NgTsDatepickerModule
  ]
```

#### Styles

Add .css file from `ng-ts-datepicker/styles.min.css` (or add it to `styles` array in `.angular-cli.json` if you are using it)

### Use component

Put it inside a element with input-group class so it gets proper icon displayed:

```html
<div class="input-group">
  <input class="form-control"
    ngTsDatepicker
    [(date)]="datepickerValue"
    [options]="datepickerOptions"
    (change)="dateChange($event)"
    (click)="dateClick()">
</div>
```

```ts
  datepickerOptions = {
    allowInputToggle: true,
    format: DATETIME_FORMAT,
    showClear: true,
    showClose: true
  };
  datepickerValue = null;

  dateChange(date: date) {}

  dateClick() {}
```

#### Properties

- date - initial date value
- options - options based on http://eonasdan.github.io/bootstrap-datetimepicker/Options/ plus some additional options:
  - preventInputKeys (prevents entering values manually into input, defaults to true)

#### Events
- change - once date is changed it will emit date object
- click - once date picker is clicked with empty value

## Dependencies

They are already in package.json, but here is a list:

- eonasdan-bootstrap-datetimepicker (http://eonasdan.github.io/bootstrap-datetimepicker/)
- jquery (https://jquery.com/)
- moment (https://momentjs.com/)

## Release notes
- 1.3.0
  - **Breaking change**: Added support for Angular6+. Now only support Angular6+, for below version, use 1.2.0
- 1.2.0
  - added styles.min.css
- 1.0.0
  - first stable version

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