{"_id":"@banminkyoz/lightpick","_rev":"1-8e0f57dc7869bb7fc242072776e51643","name":"@banminkyoz/lightpick","dist-tags":{"latest":"1.2.12"},"versions":{"1.2.12":{"name":"@banminkyoz/lightpick","version":"1.2.12","description":"Javascript date range picker - lightweight, no jQuery","main":"lightpick.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/wakirin/lightpick.git"},"keywords":["datepicker","date","daterange","date","picker","range"],"author":{"name":"Rinat G.","email":"lightpick@coding.kz","url":"http://coding.kz"},"license":"MIT","bugs":{"url":"https://github.com/wakirin/lightpick/issues"},"homepage":"https://github.com/wakirin/lightpick#readme","dependencies":{"moment":"^2.22.2"},"gitHead":"ef405b304f960ce13f3689baf26d01eb6e4c5f29","_id":"@banminkyoz/lightpick@1.2.12","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"banminkyoz","email":"banminkyoz@gmail.com"},"dist":{"integrity":"sha512-TjLmuUIXf5PPDHwlzYZJsO6Omk+4XdLd0RLin9L05j2QSyZGVwQ3XxNZpQA/G7X+h1jsS/z/03SuqlLkdtoVWg==","shasum":"50b79777f953a235b77ca31a0cff01a0b8c6eb48","tarball":"https://registry.npmjs.org/@banminkyoz/lightpick/-/lightpick-1.2.12.tgz","fileCount":10,"unpackedSize":115291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbYqdCRA9TVsSAnZWagAAIDAP/irHt+EIV8xQWYpeGYoA\nJkDHQVIrHm7QaP8zB4XZhpelR3mjrgFVDjBPVecd/CRk8B92cRiCwusxIz3f\nGdKviDvar8Ew7V2op2ym0QpQXSfhlB3qbKpOmnAjHJvCtTh/8hMxlqSD3114\noCiSICmT19alXA2E8OT7o+blT2GECpr6M6k22TCQl6ZB3D395iWblAq4z/lP\njnheDxG89J1kd7ZRjvJNnCuyKr+YclBG/wYb2GxcUdd6H3u4fIfh9TaeMK4q\nPFV4ox2yaKdGJNbX33d+T7nKAgcmZJqxX1M1OeJVC936wMKVYWSrbdVK8s+Q\nawjD81vdhiUgRiKQBcPl84mSdbeaKt6q5GvsamQgr9Ax+y04xNgBSdhl9e90\n5g0H/P9d9bqR9puF05HVSt3j1YpBTUa0Y3PM19c6sCo1CnLm4RBLfwdfuVLW\n2f59/usBMx8LZodqzjyGAz7P2rJzohWTjpznkRHZ7/HwhVtA51mvaktqxYxU\n1wLKYa4TwW5yD+/vaIESL38Q/pP2dhAEUr7mjwybvhB21e64OXhgKmrs2/rI\n7eHcLP0h6IWO2UpFCz/xZKBFJK0yjBmHDQuCfF92bVlbJxOZxUbShvsFVvbu\nHdrNSgw2EZu7CqggXfPoYmyJCDzL16EXpcxzXu/HwnCwwEN/lZgXhmRHqcsF\n1CO4\r\n=PpyD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxzfFEGPgx5lg9aNyLSdljHVQAk5ZDxzznlaZnBTvpDQIgfBqqLkdFUKMv42vxZM2iWBdcgNeFORXUcBWceyvbzek="}]},"maintainers":[{"name":"banminkyoz","email":"banminkyoz@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lightpick_1.2.12_1550682780348_0.30738983641531137"},"_hasShrinkwrap":false}},"time":{"created":"2019-02-20T17:13:00.149Z","1.2.12":"2019-02-20T17:13:00.496Z","modified":"2022-04-04T17:42:18.701Z"},"maintainers":[{"name":"banminkyoz","email":"banminkyoz@gmail.com"}],"description":"Javascript date range picker - lightweight, no jQuery","homepage":"https://github.com/wakirin/lightpick#readme","keywords":["datepicker","date","daterange","date","picker","range"],"repository":{"type":"git","url":"git+https://github.com/wakirin/lightpick.git"},"author":{"name":"Rinat G.","email":"lightpick@coding.kz","url":"http://coding.kz"},"bugs":{"url":"https://github.com/wakirin/lightpick/issues"},"license":"MIT","readme":"[![npm version](https://badge.fury.io/js/lightpick.svg)](https://www.npmjs.com/package/lightpick) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wakirin/lightpick/blob/master/LICENSE)\n\n\n\nLightpick\n=========\n\nJavascript date range picker - lightweight, no jQuery\n-----------------------------------------------------\n![screenshot](https://wakirin.github.io/Lightpick_new_style.gif)\n\n## [Demo & Docs](https://wakirin.github.io/Lightpick)\n\n----\n\n## Dependencies\n\n* [moment.js](https://www.npmjs.com/package/moment)\n\n## Installation\n\n* * *\n\n```\nnpm install lightpick\n```\n\nor you can download and include Moment.js and Lightpick files manually.\n\n## Usage\n\n* * *\n\nLightpick can be bound to an input field:\n\n```html\n<input type=\"text\" id=\"datepicker\"/>\n```\n\nInclude Lightpick script to the end of your document:\n\n```html\n<link rel=\"stylesheet\" type=\"text/css\" href=\"css/lightpick.css\">  \n...  \n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js\"></script>\n<script src=\"lightpick.js\"></script>  \n<script>  \nvar picker = new Lightpick({ field: document.getElementById('datepicker') });  \n</script>\n```\n\n## Configuration\n\n* * *\n\n### field\n- Type: `Element`\n- Default: `null` \n\nBind the datepicker to a form field\n\n### secondField\n- Type: `Element`\n- Default: `null` \n\nIf exists then end of date range will set here.\n\n### firstDay\n- Type: `Number`\n- Default: `1`\n\nISO day of the week (1: Monday, ..., 7: Sunday).\n\n### parentEl\n- Type: `String`\n- Default: `body` \n\nSelector of the parent element that the date range picker will be added to, if not provided this will be 'body'.\n\n### lang\n- Type: `String`\n- Default: `auto`\n\nLanguage code for names of days, months by [Date.prototype.toLocaleString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). 'auto' will try detect user browser language.\n\n### format\n- Type: `String`\n- Default: `DD/MM/YYYY`\n\nThe default output format.\n\n### separator\n- Type: `String`\n- Default: `-`\n\nSeparator between dates when one field.\n\n### numberOfMonths\n- Type: `Number`\n- Default: `1`\n\nNumber of visible months.\n\n### numberOfColumns\n- Type: `Number`\n- Default: `2`\n\nNumber of columns months.\n\n### singleDate\n- Type: `Boolean`\n- Default: `true`\n\nChoose a single date instead of a date range.\n\n### autoclose\n- Type: `Boolean`\n- Default: `true`\n\nClose calendar when picked date/range.\n\n### hideOnBodyClick\n- Type: `Boolean`\n- Default: `true`\n\nClose calendar when clicked outside the elements specified in `field` or `parentEl`. Recommended use when `autoclose` is set to `false`.\n\n### repick\n- Type: `Boolean`\n- Default: `false`\n\nRepick start/end instead of new range. This option working only when exists `secondField`.\n\n### minDate\n- Type: `moment|String|Number|Date`\n- Default: `null`\n\nThe minimum/earliest date that can be selected. Any format: moment() or '2018-06-01' or 1527811200000, new Date()\n\n### maxDate\n- Type: `moment|String|Number|Date`\n- Default: `null`\n\nThe maximum/latest date that can be selected. Any format: moment() or '2018-06-01' or 1527811200000, new Date()\n\n### disableDates\n- Type: `Array`\n- Default: `null`\n\nArray of disabled dates. Array can contains ranges, allowed the same format as in options minDate, maxDate. Eg.: `\\[moment().startOf('month'), \\['2018-06-23', '2018-06-30'\\]\\]`\n\n### selectForward\n- Type: `Boolean`\n- Default: `false`\n\nSelect second date after the first selected date.\n\n### selectBackward\n- Type: `Boolean`\n- Default: `false`\n\nSelect second date before the first selected date.\n\n### minDays\n- Type: `Number`\n- Default: `null`\n\nThe minimum days of the selected range.\n\n### maxDays\n- Type: `Number`\n- Default: `null`\n\nThe maximum days of the selected range.\n\n### hoveringTooltip\n- Type: `Boolean`\n- Default: `true`\n\nShow tooltip.\n\n### footer\n- Type: `Boolean|String`\n- Default: `false`\n\nFooter calendar, if set to `true` will use default footer (Reset/Apply buttons) or custom string (html).\n\n### disabledDatesInRange\n- Type: `Boolean`\n- Default: `true`\n\nIf set to `false` then will reset selected range when disabled dates exists in selected range.\n\n### tooltipNights\n- Type: `Boolean`\n- Default: `false`\n\nCalc date range in nights. (For hotels when last date doesn't include to range)\n\n### orientation\n- Type: `String`\n- Default: `auto`\n\nA space-separated string consisting of one or two of “left” or “right”, “top” or “bottom”, and “auto” (may be omitted); for example, “top left”, “bottom” (horizontal orientation will default to “auto”), “right” (vertical orientation will default to “auto”), “auto top”. \n\n### disableWeekends\n- Type: `Boolean`\n- Default: `false`\n\nDisable Saturday and Sunday.\n\n### locale\n- Type: `Object`\n- Default: \n```\n{ \n    buttons: { \n        prev: '&leftarrow;', \n        next: '&rightarrow;', \n        close: '&times;', \n        reset: 'Reset', \n        apply: 'Apply'\n    }, \n    tooltip: { \n        one: 'day',  \n        other: 'days'\n    },\n    tooltipOnDisabled: null,\n    pluralize: function(i, locale){\n        if (typeof i === \"string\") i = parseInt(i, 10);\n        \n        if (i === 1 && 'one' in locale) return locale.one;\n        if ('other' in locale) return locale.other;\n        \n        return '';\n    }\n}\n```\n`buttons` - Text for buttons\n`tooltip` - Text for tooltip (one, few, many, other)\n`tooltipOnDisabled` (String) - Show tooltip text on disabled dates. (Eg. «Already booked»)\n`pluralize` (function) - Function for calc plural text. More examples for another locales on [betsol/numerous](https://github.com/betsol/numerous/tree/master/locales)\n\n### onSelect\n- Type: `Function`\n- Default: `null`\n\nCallback function for when a date is selected.\n\n### onOpen\n- Type: `Function`\n- Default: `null`\n\nCallback function for when the picker becomes visible.\n\n### onClose\n- Type: `Function`\n- Default: `null`\n\nCallback function for when the picker is hidden.\n\n### onError\n- Type: `Function`\n- Default: `null`\n\nWorking when `disabledDatesInRange: false`\nCallback function for when user has select date range with disabled dates. \n\n## Methods\n\n* * *\n\n### picker.setDate(date)\n\nSet date when singleDate is true. `date` can be moment, string, number, date.  \nEg. `picker.setDate(new Date());`\n\n  \n### picker.setDateRange(start, end)\n\nSet date range. <code>start, end</code> can be moment, string, number, date. \nEg. `picker.setDateRange(new Date(), moment().add(7, 'day'));`\n  \n\n### picker.setDisableDates(array)\n\narray of disabled dates. Array can contains ranges, allowed moment, string, number, date.\nEg. `picker.setDisableDates([ moment().startOf('month'), ['2018-06-23', '2018-06-30'] ]);`\n\n\n### picker.getDate()\n\nReturn current date as moment object.\n\n### picker.getStartDate()\n\nReturn current start of date range as moment object.\n\n### picker.getEndDate()\n\nReturn current start of date range as moment object.\n\n### picker.toString('YYYY-MM-DD')\n\nReturns the date in a string format. \n\n### picker.reloadOptions({})\n\nUpdate picker options.\n\n### picker.show()\n\nMake the picker visible.\n\n### picker.hide()\n\nHide the picker.\n\n### picker.destroy()\n\nHide the picker and remove all event listeners.\n","readmeFilename":"README.md"}