Comparing version 1.3.6 to 1.4.0
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
[1.4.0] - 2019-10-22 | ||
* Fix minDate, maxDate, disableDates and value (gotoDate) of input now respects format parameter. | ||
[1.3.6] - 2019-10-22 | ||
@@ -5,0 +8,0 @@ * New options `onMonthsChange` and `onYearsChange` - Events fire when months or years select changed. |
@@ -137,4 +137,4 @@ /** | ||
if (opts.disableDates[i] instanceof Array || Object.prototype.toString.call(opts.disableDates[i]) === '[object Array]') { | ||
var _from = moment(opts.disableDates[i][0]), | ||
_to = moment(opts.disableDates[i][1]); | ||
var _from = moment(opts.disableDates[i][0], opts.format), | ||
_to = moment(opts.disableDates[i][1], opts.format); | ||
@@ -145,3 +145,3 @@ if (_from.isValid() && _to.isValid() && date.isBetween(_from, _to, 'day', '[]')){ | ||
} | ||
else if (moment(opts.disableDates[i]).isValid() && moment(opts.disableDates[i]).isSame(date, 'day')) { | ||
else if (moment(opts.disableDates[i], opts.format).isValid() && moment(opts.disableDates[i], opts.format).isSame(date, 'day')) { | ||
day.className.push('is-disabled'); | ||
@@ -888,5 +888,5 @@ } | ||
opts.minDate = opts.minDate && moment(opts.minDate).isValid() ? moment(opts.minDate) : null; | ||
opts.minDate = opts.minDate && moment(opts.minDate, opts.format).isValid() ? moment(opts.minDate, opts.format) : null; | ||
opts.maxDate = opts.maxDate && moment(opts.maxDate).isValid() ? moment(opts.maxDate) : null; | ||
opts.maxDate = opts.maxDate && moment(opts.maxDate, opts.format).isValid() ? moment(opts.maxDate, opts.format) : null; | ||
@@ -978,3 +978,3 @@ if (opts.lang === 'auto') { | ||
{ | ||
var date = moment(date); | ||
var date = moment(date, this._opts.format); | ||
@@ -981,0 +981,0 @@ if (!date.isValid()) { |
{ | ||
"name": "lightpick", | ||
"version": "1.3.6", | ||
"version": "1.4.0", | ||
"description": "Javascript date range picker - lightweight, no jQuery", | ||
@@ -5,0 +5,0 @@ "main": "lightpick.js", |
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
125925