From 7b9bd2487c84e47f1e2d811d8f96d8464e3f064e Mon Sep 17 00:00:00 2001 From: Yorick Phoenix Date: Fri, 23 Mar 2018 18:32:16 -0700 Subject: [PATCH] Fix changes to month dropdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using the month dropdown option changes don’t take effect because moment(opt[type])[name](value) is passed a string. The momentJS docs state that this works when name===‘month’ but testing reveals that this isn’t the case. Always passing a Number instead of a String always works. --- src/jquery.daterangepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.daterangepicker.js b/src/jquery.daterangepicker.js index 5ddbbf2..a388246 100755 --- a/src/jquery.daterangepicker.js +++ b/src/jquery.daterangepicker.js @@ -1675,7 +1675,7 @@ } function dateChanged(date) { - var value = date.val(); + var value = parseInt(date.val(), 10); var name = date.attr('name'); var type = date.parents('table').hasClass('month1') ? 'month1' : 'month2'; var oppositeType = type === 'month1' ? 'month2' : 'month1';