Skip to content

nirarazi/ng2-datepicker

 
 

Repository files navigation

ng2-datepicker

Angular2 Datepicker Component

ng2-datepicker is a reusable component for Angular2.

Demo

http://jankuri.com/components/angular2-datepicker

Installation:

npm i ng2-datepicker

If you are using SystemJS you can map to ng2-datepicker in your configuration.

<!-- index.html -->

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

<script>
  SystemJS.config({
    map: {
      "ng2-slimscroll": "node_modules/ng2-slimscroll/ng2-slimscroll.js",
      "moment": "node_modules/moment/moment.js"
    }
  });
</script>

Use Example:

import {Component} from 'angular2/core';
import {FORM_DIRECTIVES} from 'angular2/common';
import {DatePicker} from 'ng2-datepicker';

class Test {
  date: string;
}

@Component({
  template: `
    <datepicker [(ngModel)]="test.date"></datepicker>
    <datepicker [(ngModel)]="test1.date" view-value="DD.MM.YYYY" model-value="DD.MM.YYYY" init-date="12.5.2017"></datepicker>
  `,
  directives: [DatePicker, FORM_DIRECTIVES]
})

class App {
  test: Test;
  test1: Test;
  
  constructor() {
    this.test = Test();
    this.test1 = Test();
  }
}

Author

Jan Kuri

Licence

This project is licensed under the MIT license. See the LICENSE file for more info.

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 52.7%
  • CSS 35.9%
  • HTML 11.4%