Skip to content

Commit

Permalink
Allow updates from typing in a form input to work with the single dat…
Browse files Browse the repository at this point in the history
…e picker
  • Loading branch information
dangrossman committed Jan 16, 2014
1 parent 89be8ab commit b1477e2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions daterangepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -973,4 +978,4 @@
return this;
};

}(window.jQuery);
}(window.jQuery);

0 comments on commit b1477e2

Please # to comment.