An open API service indexing awesome lists of open source software.

https://github.com/icklechris/ic-datepicker

Angular (2+) datepicker component
https://github.com/icklechris/ic-datepicker

angular angular2 datepicker datepicker-component ng2

Last synced: 13 days ago
JSON representation

Angular (2+) datepicker component

Awesome Lists containing this project

README

        

# Ic Datepicker

[Docs & Example](https://icklechris.github.io/ic-datepicker)

**Warning:** This component is still in pre-release. Although the component should be stable, until v1 is released there is potential for API changes whilst things are finalised. To prevent issues, ensure your `package.json` file specifies a specific version (e.g. `"ic-datepicker": "0.0.5"`).

## Installation

Install the component via NPM;

```
npm install -S ic-datepicker
(or)
yarn add ic-datepicker
```

Import the `IcDatepickerModule` into your module;

```typescript
// app.module.ts

import { IcDatepickerModule } from 'ic-datepicker';

@NgModule({
imports: [
IcDatepickerModule,
],
})
```

## Usage

Use the `` element, optionally providing an `IcDatepickerOptionsInterface` instance containing overriding options ([see defaults](https://icklechris.github.io/ic-datepicker/options)).

```typescript
import { IcDatepickerOptionsInterface } from 'ic-datepicker';

@Component({
selector: 'my-example-component',
template: `







`,
styles: ``
})
export class MyExampleComponent implements OnInit {
datepickerOptions: IcDatepickerOptionsInterface;
exampleForm: FormGroup;
modelDatepicker: any;

ngOnInit() {
this.datepickerOptions = {
position: 'top'
};

this.exampleForm = new FormGroup({
datepicker: new FormControl()
});
}
}

```