From b1477e20fc1683b72ea66b2fb022cf9df203aece Mon Sep 17 00:00:00 2001 From: Dan Grossman Date: Wed, 15 Jan 2014 23:03:25 -0500 Subject: [PATCH] Allow updates from typing in a form input to work with the single date picker --- daterangepicker.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daterangepicker.js b/daterangepicker.js index 59c8dcd8..11ad0f1a 100644 --- a/daterangepicker.js +++ b/daterangepicker.js @@ -422,6 +422,11 @@ var start = moment(dateString[0], this.format); var end = moment(dateString[1], this.format); + if (this.singleDatePicker) { + start = moment(this.element.val(), this.format); + end = start; + } + if (start == null || end == null) return; if (end.isBefore(start)) return; @@ -450,7 +455,7 @@ left: this.parentEl.offset().left - this.parentEl.scrollLeft() }; } - + if (this.opens == 'left') { this.container.css({ top: this.element.offset().top + this.element.outerHeight() - parentOffset.top, @@ -973,4 +978,4 @@ return this; }; -}(window.jQuery); +}(window.jQuery); \ No newline at end of file