Angular 2 date range picker - Angular2 reusable UI component
Simple Angular2 date range picker. Online demo is here
- Fork and clone this repo
- npm install
- Open a terminal and type "npm start"
- Open "http://localhost:5000" to browser
To install this component to an external project, follow the procedure:
-
Make sure you're using Webpack.
-
npm install mydaterangepicker
. -
import {MyDateRangePicker} from 'MyDateRangePicker/src/index';
-
Use the following snippet inside your template:
<my-date-range-picker [options]="myDateRangePickerOptions" (dateRangeChanged)="onDateRangeChanged($event)" [selDateRange]="selectedDateRange"></my-date-range-picker>
All input properties are optional.
Bind to an object containing replacements for any of the following defaults:
{su: 'Sun', mo: 'Mon', tu: 'Tue', we: 'Wed', th: 'Thu', fr: 'Fri', sa: 'Sat'}
{ 1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun', 7: 'Jul', 8: 'Aug', 9: 'Sep', 10: 'Oct', 11: 'Nov', 12: 'Dec' }
'yyyy-mm-dd'
'Clear'
'Begin Date'
'End Date'
'OK'
'Select Begin Date'
'Select End Date'
'mo'
true
false
'34px'
'100%'
Provide the initially chosen date range that will display both in the text input field and the selector.
Online demo is here
- Firefox (latest)
- Chromium (latest)
- Edge
- IE11
- License: MIT
- Author: kekeh