JSPM

  • Created
  • Published
  • Downloads 520
  • Score
    100M100P100Q102645F
  • License ISC

Angular2 DateTime Picker

Package Exports

  • ng2-datetime-picker

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ng2-datetime-picker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ng2-datetime-picker

AngularJS 2 DateTime Picker

Install

  1. install ng2-datetime-picker

     $ npm install ng2-datetime-picker --save
  2. add map and packages to your systemjs.config.js

     map['datetime-picker'] = 'node_modules/ng2-datetime-picker';
     // map['datetime-picker'] = 'https://npmcdn.com/ng2-datetime-picker'; // or without npm installation
     packages['datetime-picker'] = { main: 'dist/index.js', defaultExtension: 'js'

Usage it in your code

  1. import and add directive in your component

     import {DateTimePickerDirective} from "datetime-picker";
     ...
     @Component({
       directives: [DateTimePickerDirective],
       ..
     });
  2. You are ready. use it in your template

     <input [(ngModel)]="date1" datetime-picker date-only="true" />

attributes

All options are optional except ngModel

  • ngModel, date variable
  • year, e.g., 2016, default: current year
  • month, e.g., 6, default: current month
  • day, e.g., 13, default: current day
  • hour, e.g. 23, default: current hour
  • minute e.g. 59, default: current minute
  • date-format, Angular2 DatePipe date format default: 'yMd'
  • date-only, true or false, default is false
  • close-on-select, true or false. indicates to close datetime-picker when select a date. default: true