Skip to content

Commit b1477e2

Browse files
committed
Allow updates from typing in a form input to work with the single date picker
1 parent 89be8ab commit b1477e2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

daterangepicker.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,11 @@
422422
var start = moment(dateString[0], this.format);
423423
var end = moment(dateString[1], this.format);
424424

425+
if (this.singleDatePicker) {
426+
start = moment(this.element.val(), this.format);
427+
end = start;
428+
}
429+
425430
if (start == null || end == null) return;
426431
if (end.isBefore(start)) return;
427432

@@ -450,7 +455,7 @@
450455
left: this.parentEl.offset().left - this.parentEl.scrollLeft()
451456
};
452457
}
453-
458+
454459
if (this.opens == 'left') {
455460
this.container.css({
456461
top: this.element.offset().top + this.element.outerHeight() - parentOffset.top,
@@ -973,4 +978,4 @@
973978
return this;
974979
};
975980

976-
}(window.jQuery);
981+
}(window.jQuery);

0 commit comments

Comments
 (0)