jonthornton / Datepair.js

A javascript plugin for intelligently selecting date and time ranges, inspired by Google Calendar.
https://www.jonthornton.com/Datepair.js
359 stars 85 forks source link

Refresh Method for Programmatic update of Fields after Initialization #19

Closed kylethielk closed 10 years ago

kylethielk commented 10 years ago

I came across an issue when re-using datepair start/end fields. The timeDelta and dateDelta would be out of sync with the new data since the initial timeDelta and dateDelta are only set when first calling .datepicker().

I updated datepair.js to include a method called refresh that simply resets the timeDelta and dateDelta to reflect the values in the date and time fields.

jonthornton commented 10 years ago

Great addition - thanks!