Comparing version 1.2.6 to 1.2.7
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
[1.2.7] - 2018-12-10 | ||
* fix bug when used both options `repick` and `minDays` (on repick date `minDays` was ignored) | ||
[1.2.6] - 2018-11-08 | ||
@@ -5,0 +8,0 @@ * new option: orientation |
@@ -173,2 +173,21 @@ /** | ||
if (opts.repick && (opts.minDays || opts.maxDays) && opts.startDate && opts.endDate) { | ||
var tempStartDate = moment(opts.repickTrigger == opts.field ? opts.endDate : opts.startDate); | ||
if (opts.minDays) { | ||
if (date.isBetween(moment(tempStartDate).subtract(opts.minDays - 1, 'day'), moment(tempStartDate).add(opts.minDays - 1, 'day'), 'day')) { | ||
day.className.push('is-disabled'); | ||
} | ||
} | ||
if (opts.maxDays) { | ||
if (date.isSameOrBefore(moment(tempStartDate).subtract(opts.maxDays, 'day'), 'day')) { | ||
day.className.push('is-disabled'); | ||
} | ||
else if (date.isSameOrAfter(moment(tempStartDate).add(opts.maxDays, 'day'), 'day')) { | ||
day.className.push('is-disabled'); | ||
} | ||
} | ||
} | ||
if (date.isSame(new Date(), 'day')) { | ||
@@ -175,0 +194,0 @@ day.className.push('is-today'); |
{ | ||
"name": "lightpick", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "Javascript date range picker - lightweight, no jQuery", | ||
@@ -5,0 +5,0 @@ "main": "lightpick.js", |
@@ -18,3 +18,3 @@ [![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) | ||
* Moment.js | ||
* [moment.js](https://www.npmjs.com/package/moment) | ||
@@ -37,3 +37,3 @@ ## Installation | ||
``` | ||
```html | ||
<input type="text" id="datepicker"/> | ||
@@ -44,3 +44,3 @@ ``` | ||
``` | ||
```html | ||
<link rel="stylesheet" type="text/css" href="css/lightpick.css"> | ||
@@ -47,0 +47,0 @@ ... |
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
110411
1849