Skip to content

Commit c9a9098

Browse files
trentrichardson#585 add ability to setDate with date string
1 parent 0ad686a commit c9a9098

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,13 @@
15661566
return;
15671567
}
15681568

1569+
if(typeof(date) === 'string'){
1570+
date = new Date(date);
1571+
if(!date.getTime()){
1572+
$.timepicker.log("Error creating Date object from string.");
1573+
}
1574+
}
1575+
15691576
var tp_inst = this._get(inst, 'timepicker'),
15701577
tp_date = (date instanceof Date) ? new Date(date.getTime()) : date;
15711578

0 commit comments

Comments
 (0)