jonthornton/Datepair.js — pull request #14 by rhec (2014-07-02 22:58:48+00:00)
Title: set time and date deltas on init when inputs have values

This fixes issues I had with Datepair.js when attaching it to form inputs which already had values. The time and date deltas were not set in that case, so when you changed the start of the pair it changed the end to the same value.

It probably could be done a little more nicely so the code to set deltas is shared between the Datepair constructor and the _dateChanged and _timeChanged functions. I'll leave it up to you to make that call as I haven't really spent a ton of time looking at how it's organized.