Skip to content

Commit

Permalink
Helper function setTime() now takes a string in addition to a date ob…
Browse files Browse the repository at this point in the history
…ject. Thanks to Christine Yen (christineyen) for the idea.
  • Loading branch information
perifer committed Mar 13, 2011
1 parent 0d08f40 commit 3dfbfce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jquery.timePicker.js
Expand Up @@ -187,9 +187,9 @@
return timeStringToDate(elm.value, settings);
};
// Helper function to set a time input.
// Takes a Date object.
// Takes a Date object or string.
this.setTime = function(time) {
elm.value = formatTime(normaliseTime(time), settings);
elm.value = formatTime(timeToDate(time, settings), settings);
// Trigger element's change events.
$(elm).change();
};
Expand Down

0 comments on commit 3dfbfce

Please sign in to comment.