Update datePicker.js

OK, it may not be pretty, but I think I got it working at last.