Comparing version 1.2.10 to 1.2.11
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
[1.2.11] - 2019-02-13 | ||
* Improve sync values with fields | ||
[1.2.10] - 2019-02-12 | ||
@@ -5,0 +8,0 @@ * fixed bug #36 |
@@ -755,3 +755,3 @@ /** | ||
this.syncFields(); | ||
self.syncFields(); | ||
@@ -906,8 +906,23 @@ if (!self.isShowing) { | ||
{ | ||
if (moment(this._opts.field.value, this._opts.format).isValid()) { | ||
this._opts.startDate = moment(this._opts.field.value, this._opts.format); | ||
if (this._opts.singleDate || this._opts.secondField) { | ||
if (moment(this._opts.field.value, this._opts.format).isValid()) { | ||
this._opts.startDate = moment(this._opts.field.value, this._opts.format); | ||
} | ||
if (this._opts.secondField && moment(this._opts.secondField.value, this._opts.format).isValid()) { | ||
this._opts.endDate = moment(this._opts.secondField.value, this._opts.format); | ||
} | ||
} | ||
else { | ||
var dates = this._opts.field.value.split(this._opts.separator); | ||
if (this._opts.secondField && moment(this._opts.secondField.value, this._opts.format).isValid()) { | ||
this._opts.endDate = moment(this._opts.secondField.value, this._opts.format); | ||
if (dates.length === 2) { | ||
if (moment(dates[0], this._opts.format).isValid()) { | ||
this._opts.startDate = moment(dates[0], this._opts.format); | ||
} | ||
if (moment(dates[1], this._opts.format).isValid()) { | ||
this._opts.endDate = moment(dates[1], this._opts.format); | ||
} | ||
} | ||
} | ||
@@ -914,0 +929,0 @@ }, |
{ | ||
"name": "lightpick", | ||
"version": "1.2.10", | ||
"version": "1.2.11", | ||
"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
115772
1879