tamble / jquery-ui-daterangepicker

A JQuery UI based date range picker.
MIT License
184 stars 108 forks source link

clearRange setting object as value of the original input #2

Closed igorbrites closed 9 years ago

igorbrites commented 9 years ago

Hi, I figured out that when I call the clearRange() method, it calls the reset() method, and it is passing an object inside the jQuery val() method ({start: null, end: null}), and this is causing a [object Object] to appear where the val should be a string not an object.

I think that it's better pass the object as string ('{start: null, end: null}') will fix.

Thanks!

op16 commented 9 years ago

Thanks for your analysis. I think the simplest fix is to use val('') in the reset() method. The alternative is to wrap the range object in JSON.stringify().

igorbrites commented 9 years ago

Perfect! Thanks!