{"maintainers":[{"name":"anonymous","email":"armache@yahoo.com"}],"keywords":["Angular2","date range picker"],"dist-tags":{"latest":"1.0.14"},"author":{"name":"kekeh"},"description":"Angular2 date range picker","readme":"# mydaterangepicker\r\n\r\n**Angular 2 date range picker - Angular2 reusable UI component**\r\n\r\n[![Build Status](https://travis-ci.org/kekeh/mydaterangepicker.svg?branch=master)](https://travis-ci.org/kekeh/mydaterangepicker)\r\n[![codecov](https://codecov.io/gh/kekeh/mydaterangepicker/branch/master/graph/badge.svg)](https://codecov.io/gh/kekeh/mydaterangepicker)\r\n[![npm](https://img.shields.io/npm/v/mydaterangepicker.svg?maxAge=2592000?style=flat-square)](https://www.npmjs.com/package/mydaterangepicker)\r\n\r\n## Description\r\nSimple Angular2 date range picker. Online demo is [here](http://kekeh.github.io/mydaterangepicker)\r\n\r\n## Installation\r\n\r\nTo install this component to an external project, follow the procedure:\r\n\r\n1. __npm install mydaterangepicker --save__\r\n2. Add __MyDateRangePickerModule__ import to your __@NgModule__ like example below\r\n    ```js\r\n    import { NgModule } from '@angular/core';\r\n    import { BrowserModule } from '@angular/platform-browser';\r\n    import { MyTestApp } from './my-test-app';\r\n\r\n    // If you are using webpack package loader import the MyDateRangePickerModule from here:\r\n    import { MyDateRangePickerModule } from 'mydaterangepicker';\r\n\r\n    // If you are using systemjs package loader import the MyDateRangePickerModule from here:\r\n    import { MyDateRangePickerModule } from 'mydatepicker/dist/my-date-range-picker.module';\r\n\r\n    @NgModule({\r\n        imports:      [ BrowserModule, MyDateRangePickerModule ],\r\n        declarations: [ MyTestApp ],\r\n        bootstrap:    [ MyTestApp ]\r\n    })\r\n    export class MyTestAppModule {}\r\n    ```\r\n3. Use the following snippet inside your template:\r\n\r\n   ```html\r\n   <my-date-range-picker [options]=\"myDateRangePickerOptions\"\r\n                   (dateRangeChanged)=\"onDateRangeChanged($event)\"></my-date-range-picker>\r\n   ```\r\n\r\n    * Mandatory attributes:\r\n      * [options]=\"myDateRangePickerOptions\"\r\n      * (dateRangeChanged)=\"onDateRangeChanged($event)\"\r\n\r\n    * Optional attributes:\r\n      * [selDateRange]=\"selectedDateRange\"\r\n      * (inputFieldChanged)=\"onInputFieldChanged($event)\"\r\n      * (calendarViewChanged)=\"onCalendarViewChanged($event)\"\r\n\r\n4. If you are using __systemjs__ package loader add the following mydaterangepicker properties to the __System.config__:\r\n    ```js\r\n    (function (global) {\r\n        System.config({\r\n            paths: {\r\n                'npm:': 'node_modules/'\r\n            },\r\n            map: {\r\n                // Other components are here...\r\n\r\n                'mydaterangepicker': 'npm:mydaterangepicker',\r\n            },\r\n            packages: {\r\n                // Other components are here...\r\n\r\n                mydaterangepicker: {\r\n                    defaultExtension: 'js'\r\n                }\r\n            }\r\n        });\r\n    })(this);\r\n    ```\r\n\r\n## Usage\r\n\r\n### options attribute\r\n\r\n| Option        | Default       | Description  |\r\n| ------------- | ------------- | ----- |\r\n| __dayLabels__     | {su: 'Sun', mo: 'Mon', tu: 'Tue', we: 'Wed', th: 'Thu', fr: 'Fri', sa: 'Sat'} | Day labels visible on the selector. |\r\n| __monthLabels__   | { 1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun', 7: 'Jul', 8: 'Aug', 9: 'Sep', 10: 'Oct', 11: 'Nov', 12: 'Dec' } | Month labels visible on the selector. |\r\n| __dateFormat__    | yyyy-mm-dd      | Date format on the selection area and the callback. For example: dd.mm.yyyy, yyyy-mm-dd, dd mmm yyyy (mmm = Month as a text) |\r\n| __showClearBtn__   | true      | Show 'Clear' button on calendar. |\r\n| __clearBtnTxt__   | Clear      | Clear button text. Can be used if __showClearBtn = true__. |\r\n| __beginDateBtnTxt__   | Begin Date      | To begin date button text. |\r\n| __endDateBtnTxt__   | End Date      | To end date button text. |\r\n| __acceptBtnTxt__   | OK      | Accept date range button text. |\r\n| __showSelectDateText__   | true      | Show select date text. |\r\n| __selectBeginDateTxt__   | Select Begin Date      | Select begin date text. Can be used if __showSelectDateText = true__.|\r\n| __selectEndDateTxt__   | Select End Date      | Select end date text. Can be used if __showSelectDateText = true__.  |\r\n| __firstDayOfWeek__   | mo | First day of week on calendar. One of the following: mo, tu, we, th, fr, sa, su |\r\n| __sunHighlight__   | true | Sunday red colored on calendar. |\r\n| __markCurrentDay__   | true | Is current day (today) marked on calendar. |\r\n| __editableMonthAndYear__   | true | Is month and year labels editable or not. |\r\n| __minYear__   | 1000 | Minimum allowed year in calendar. Cannot be less than 1000. |\r\n| __maxYear__   | 9999 | Maximum allowed year in calendar. Cannot be more than 9999. |\r\n| __inline__   | false | Show mydaterangepicker in inline mode. |\r\n| __height__   | 34px | mydatepicker height without selector. Can be used if __inline = false__. |\r\n| __width__   | 100% | mydatepicker width. Can be used if __inline = false__. |\r\n| __selectionTxtFontSize__   | 18px | Selection area font size. Can be used if __inline = false__. |\r\n| __alignSelectorRight__   | false | Align selector right. Can be used if __inline = false__. |\r\n| __indicateInvalidDateRange__   | true | If user typed date range is not same format as __dateFormat__, show red background in the selection area. Can be used if __inline = false__. |\r\n| __showDateRangeFormatPlaceholder__   | false | Show value of __dateFormat__ - __dateFormat__ as placeholder in the selection area if it is empty. Can be used if __inline = false__. |\r\n| __customPlaceholderTxt__   | empty string | Show custom string in the selection area if a date range is not selected. Can be used if __showDateRangeFormatPlaceholder = false__ and __inline = false__. |\r\n| __componentDisabled__   | false | Is selection area input field and buttons disabled or not (input disabled flag). Can be used if __inline = false__. |\r\n| __editableDateRangeField__   | true | Is selection area input field editable or not (input readonly flag). Can be used if __inline = false__. |\r\n| __inputValueRequired__   | false | Is selection area input field value required or not (input required flag). Can be used if __inline = false__. |\r\n\r\n* Example of the options data (not all properties listed):\r\n```js\r\n    myDateRangePickerOptions = {\r\n        clearBtnTxt: 'Clear',\r\n        beginDateBtnTxt: 'Begin Date',\r\n        endDateBtnTxt: 'End Date',\r\n        acceptBtnTxt: 'OK',\r\n        dateFormat: 'dd.mm.yyyy',\r\n        firstDayOfWeek: 'mo',\r\n        sunHighlight: true,\r\n        height: '34px',\r\n        width: '260px',\r\n        inline: false,\r\n        selectionTxtFontSize: '15px',\r\n        alignSelectorRight: false,\r\n        indicateInvalidDateRange: true,\r\n        showDateRangeFormatPlaceholder: false\r\n    };\r\n```\r\n\r\n### selDateRange attribute\r\n\r\nProvide the initially chosen date range that will display both in the text input field\r\nand provide the default for the popped-up selector.\r\n\r\n### defaultMonth attribute\r\n\r\nIf __selDateRange__ is not specified, when the daterangepicker is opened, it will\r\nordinarily default to selecting the current date. If you would prefer\r\na different year and month to be the default for a freshly chosen date\r\npicking operation, specify a __[defaultMonth]__ attribute.\r\n\r\nValue of the __[defaultMonth]__ attribute is a string which contain year number and\r\nmonth number separated by delimiter. The delimiter can be any special character.\r\nFor example the value of the __[defaultMonth]__ attribute can be: __2016.08__,\r\n__08-2016__, __08/2016__.\r\n\r\n### dateRangeChanged callback:\r\n  * called when the date range is selected, removed or input field typing is valid\r\n  * event parameter:\r\n    * event.beginDate: Date object in the following format: { day: 22, month: 11, year: 2016 }\r\n    * event.endDate: Date object in the following format: { day: 23, month: 11, year: 2016 }\r\n    * event.formatted: Date range string: '2016-11-22 - 2016-11-23'\r\n    * event.beginEpoc: Epoc time stamp number: 1479765600\r\n    * event.endEpoc: Epoc time stamp number: 1479852000\r\n\r\n  * Example of the dateChanged callback:\r\n  ```js\r\n      onDateRangeChanged(event:any) {\r\n          console.log('onDateRangeChanged(): Begin date: ', event.beginDate, ' End date: ', event.endDate);\r\n          console.log('onDateRangeChanged(): Formatted: ', event.formatted);\r\n          console.log('onDateRangeChanged(): BeginEpoc timestamp: ', event.beginEpoc, ' - endEpoc timestamp: ', event.endEpoc);\r\n      }\r\n  ```\r\n\r\n### inputFieldChanged callback:\r\n  * called when the value change in the input field, date range is selected or date range is cleared (can be used in validation, returns true or false indicating is date range valid or not in the input field)\r\n  * event parameter:\r\n    * event.value: Value of the input field. For example: '2016-11-22 - 2016-11-23'\r\n    * event.dateRangeFormat: Date range format string. For example: 'yyyy-mm-dd - yyyy-mm-dd'\r\n    * event.valid: Boolean value indicating is the typed value valid. For example: true\r\n\r\n  * Example of the input field changed callback:\r\n  ```js\r\n  onInputFieldChanged(event:any) {\r\n    console.log('onInputFieldChanged(): Value: ', event.value, ' - dateRangeFormat: ', event.dateRangeFormat, ' - valid: ', event.valid);\r\n  }\r\n  ```\r\n\r\n### calendarViewChanged callback:\r\n  * called when the calendar view change (year or month change)\r\n  * event parameter:\r\n    * event.year: Year number in calendar. For example: 2016\r\n    * event.month: Month number in calendar. For example: 11\r\n    * event.first: First day of selected month and year. Object which contain day number and weekday string. For example: {number: 1, weekday: \"tu\"}\r\n    * event.last: Last day of selected month and year. Object which contain day number and weekday string. For example: {number: 30, weekday: \"we\"}\r\n  * values of the weekday property are same as values of the __firstDayOfWeek__ option\r\n\r\n  * Example of the calendar view changed callback:\r\n  ```js\r\n  onCalendarViewChanged(event:any) {\r\n    console.log('onCalendarViewChanged(): Year: ', event.year, ' - month: ', event.month, ' - first: ', event.first, ' - last: ', event.last);\r\n  }\r\n  ```\r\n\r\n### Change styles of the component\r\n\r\nThe styles of the component can be changed by overriding the existing styles.\r\n\r\nCreate a separate stylesheet file which contain the changed styles. Then import the stylesheet file in the place which\r\nis after the place where the component is loaded.\r\n\r\nThe [sampleapp](https://github.com/kekeh/mydaterangepicker/tree/master/sampleapp) of the component contain an example:\r\n\r\n* [override.css](https://github.com/kekeh/mydaterangepicker/blob/master/sampleapp/override.css) contain the changed styles.\r\n* [index.html](https://github.com/kekeh/mydaterangepicker/blob/master/sampleapp/index.html) contain import of the override.css file.\r\n\r\n## Development of this component\r\n\r\n* At first fork and clone this repo.\r\n\r\n* Install all dependencies:\r\n  1. __npm install__\r\n  2. __npm install --global gulp-cli__\r\n\r\n* Build __dist__ and __npmdist__ folders and execute __tslint__:\r\n  1. __gulp all__\r\n\r\n* Execute unit tests and coverage (output is generated to the __test-output__ folder):\r\n  1. __npm test__\r\n\r\n* Run sample application:\r\n  1. Open a terminal and type __npm start__\r\n  2. Open __http://localhost:5000__ to browser\r\n\r\n* Build a local npm installation package:\r\n  1. __gulp all__\r\n  2. __cd npmdist__\r\n  3. __npm pack__\r\n    * local installation package is created to the __npmdist__ folder. For example: __mydaterangepicker-1.0.10.tgz__\r\n\r\n* Install the local npm package to your project:\r\n  1. __npm install path_to_npmdist/mydaterangepicker-1.0.10.tgz__\r\n\r\n## Demo\r\nOnline demo is [here](http://kekeh.github.io/mydaterangepicker)\r\n\r\n## Compatibility (tested with)\r\n* Firefox (latest)\r\n* Chrome (latest)\r\n* Chromium (latest)\r\n* Edge\r\n* IE11\r\n* Safari\r\n\r\n## License\r\n* License: MIT\r\n\r\n## Author\r\n* Author: kekeh\r\n","repository":{"type":"git","url":"git+https://github.com/kekeh/mydaterangepicker.git"},"users":{"sudhirkumark":true},"bugs":{"url":"https://github.com/kekeh/mydaterangepicker/issues"},"license":"MIT","versions":{"1.0.14":{"name":"mydaterangepicker2","version":"1.0.14","description":"Angular2 date range picker","keywords":["Angular2","date range picker"],"author":{"name":"kekeh"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kekeh/mydaterangepicker.git"},"files":["LICENSE","package.json","README.md","index.ts","src","dist"],"scripts":{"start":"webpack-dev-server --config config/webpack.dev.js --progress","build.dist":"gulp all","build.webpack.sampleapp":"rimraf build && webpack --config config/webpack.sampleapp.build.js --progress --profile --bail","test":"karma start config/karma.conf.js","tslint":"gulp tslint"},"dependencies":{},"devDependencies":{"@angular/common":"~2.2.0","@angular/compiler":"~2.2.0","@angular/core":"~2.2.0","@angular/platform-browser":"~2.2.0","@angular/platform-browser-dynamic":"~2.2.0","@types/jasmine":"^2.5.38","@types/node":"^6.0.47","@types/core-js":"^0.9.34","angular2-template-loader":"^0.6.0","awesome-typescript-loader":"^2.2.4","codecov":"^1.0.1","codelyzer":"^2.0.0-beta.1","concurrently":"^3.0.0","core-js":"^2.4.1","css-loader":"^0.26.1","es6-promise":"^4.0.5","es6-shim":"~0.35.1","extract-text-webpack-plugin":"^1.0.1","file-loader":"^0.9.0","gulp":"^3.9.1","gulp-clean":"^0.3.2","gulp-clean-css":"^2.0.12","gulp-htmlmin":"^3.0.0","gulp-replace":"^0.5.4","gulp-tslint":"^7.0.1","gulp-typescript":"^3.1.3","html-loader":"^0.4.3","html-webpack-plugin":"^2.24.1","istanbul-instrumenter-loader":"0.2.0","jasmine-core":"~2.5.2","karma":"^1.3.0","karma-cli":"^1.0.1","karma-coverage":"^1.1.1","karma-htmlfile-reporter":"^0.3.4","karma-jasmine":"^1.0.2","karma-jasmine-html-reporter":"^0.2.2","karma-phantomjs-launcher":"^1.0.2","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.8.0","merge2":"^1.0.2","null-loader":"^0.1.1","postcss-loader":"^1.1.1","raw-loader":"^0.5.1","reflect-metadata":"^0.1.8","rimraf":"^2.5.2","run-sequence":"^1.2.2","rxjs":"5.0.0-beta.12","source-map-loader":"^0.1.5","style-loader":"^0.13.1","systemjs":"0.19.41","systemjs-builder":"^0.15.34","to-string-loader":"^1.1.4","tslint":"^4.0.2","typescript":"2.1.1","webpack":"^1.13.3","webpack-dev-server":"^1.16.2","webpack-livereload-plugin":"~0.9.0","webpack-merge":"^1.0.2","zone.js":"^0.6.25"},"gitHead":"79915e71212677ef78aedc27e16ab9c9a48b649d","bugs":{"url":"https://github.com/kekeh/mydaterangepicker/issues"},"homepage":"https://github.com/kekeh/mydaterangepicker#readme","_id":"mydaterangepicker2@1.0.14","_shasum":"6604a755dc9edb1219ecf42f76d3d2edd4880075","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"anonymous","email":"armache@yahoo.com"},"dist":{"shasum":"6604a755dc9edb1219ecf42f76d3d2edd4880075","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/mydaterangepicker2/-/mydaterangepicker2-1.0.14.tgz","integrity":"sha512-xVwMtuZQ26Q2Z55zdHZK6syrU9KoSo4G71x1faCal+vHtv3u/lFI2b4mpMVFqvJ3gXAG/uKVl56ibGQybl/kzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0FFlAdctfGu07vucOT++TlPXL1L3vIU4agCV83hFZ+AiEAlVOdYH0DtZyzahv9ypoRxSANtI3zFMzFzDYqVrVeL5U="}]},"maintainers":[{"name":"anonymous","email":"armache@yahoo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/mydaterangepicker2-1.0.14.tgz_1482113213381_0.7977449088357389"}}},"name":"mydaterangepicker2","time":{"modified":"2022-06-20T17:06:18.069Z","created":"2016-12-19T02:06:55.467Z","1.0.14":"2016-12-19T02:06:55.467Z"},"readmeFilename":"README.md","homepage":"https://github.com/kekeh/mydaterangepicker#readme"}