One of the bigger challenges in taming legacy code is the size and scope of the existing functions. Larger functions have more dependencies and more complicated logic. You first need to write characterization tests to capture the intent before refactoring to smaller, more focused functions. The functions that I deferred so far fall in that category. I had run out of simple functions and needed to forge ahead.
The next most complicated functions were the date and time parsing utility functions deferred earlier. Of the two remaining functions,
splitDateTime() was the easier. For one,
splitDateTime(), and it also calls other functions of the
datepicker, both original ...