Comparing version 1.3.1 to 1.3.2
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
[1.3.2] - 2019-03-22 | ||
* New option: `dropdowns` | ||
[1.3.1] - 2019-03-22 | ||
@@ -5,0 +8,0 @@ * New option: `inline` (default is `false`) |
@@ -49,6 +49,2 @@ /** | ||
maxDays: null, | ||
onSelect: null, | ||
onOpen: null, | ||
onClose: null, | ||
onError: null, | ||
hoveringTooltip: true, | ||
@@ -62,5 +58,8 @@ hideOnBodyClick: true, | ||
inline: false, | ||
years: { | ||
min: 1900, | ||
max: null, | ||
dropdowns: { | ||
years: { | ||
min: 1900, | ||
max: null, | ||
}, | ||
months: true, | ||
}, | ||
@@ -87,4 +86,9 @@ locale: { | ||
return ''; | ||
} | ||
}, | ||
}, | ||
onSelect: null, | ||
onOpen: null, | ||
onClose: null, | ||
onError: null, | ||
}, | ||
@@ -285,2 +289,6 @@ | ||
select.dir = 'rtl'; | ||
if (!opts.dropdowns || !opts.dropdowns.months) { | ||
select.disabled = true; | ||
} | ||
@@ -294,4 +302,5 @@ return select.outerHTML; | ||
select = document.createElement('select'), | ||
minYear = opts.years.min ? opts.years.min : 1900, | ||
maxYear = opts.years.max ? opts.years.max : Number.parseInt(moment().format('YYYY')); | ||
years = opts.dropdowns && opts.dropdowns.years ? opts.dropdowns.years : null, | ||
minYear = years && years.min ? years.min : 1900, | ||
maxYear = years && years.max ? years.max : Number.parseInt(moment().format('YYYY')); | ||
@@ -322,2 +331,6 @@ if (Number.parseInt(date.format('YYYY')) < minYear) { | ||
if (!opts.dropdowns || !opts.dropdowns.years) { | ||
select.disabled = true; | ||
} | ||
return select.outerHTML; | ||
@@ -324,0 +337,0 @@ }, |
{ | ||
"name": "lightpick", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Javascript date range picker - lightweight, no jQuery", | ||
@@ -5,0 +5,0 @@ "main": "lightpick.js", |
@@ -218,2 +218,19 @@ [![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) | ||
### dropdowns | ||
- Type: `Object|Boolean` | ||
- Default: | ||
``` | ||
{ | ||
years: { | ||
min: 1900, | ||
max: null, | ||
}, | ||
months: true, | ||
} | ||
``` | ||
Dropdown selections for years, months. Can be `false` for disable both dropdowns. | ||
`years` _(Object|Boolean)_ - Object must contains `min` and `max` range of years or can be `false` for disable dropdown of years. | ||
`months` _(Boolean)_ - `true/false` for enable/disable dropdown of months. | ||
### locale | ||
@@ -246,6 +263,6 @@ - Type: `Object` | ||
``` | ||
`buttons` - Text for buttons | ||
`tooltip` - Text for tooltip (one, few, many, other) | ||
`tooltipOnDisabled` (String) - Show tooltip text on disabled dates. (Eg. «Already booked») | ||
`pluralize` (function) - Function for calc plural text. More examples for another locales on [betsol/numerous](https://github.com/betsol/numerous/tree/master/locales) | ||
`buttons` - Text for buttons | ||
`tooltip` - Text for tooltip (one, few, many, other) | ||
`tooltipOnDisabled` (String) - Show tooltip text on disabled dates. (Eg. «Already booked») | ||
`pluralize` (function) - Function for calc plural text. More examples for another locales on [betsol/numerous](https://github.com/betsol/numerous/tree/master/locales) | ||
@@ -252,0 +269,0 @@ ### onSelect |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120644
1875
345