Skip to content

Commit 41a0cd3

Browse files
committed
make datepicker use given 'value' of date input as initial value, instead of always using today
1 parent 28eddbb commit 41a0cd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

experiments/ui-datepicker/jquery.ui.datepicker.mobile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
//bind to pagecreate to automatically enhance date inputs
5050
$( ".ui-page" ).live( "pagecreate", function(){
5151
$( "input[type='date'], input:jqmData(type='date')" ).each(function(){
52-
$(this).after( $( "<div />" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) );
52+
$(this).after( $( "<div />" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true, defaultDate: $(this).val() }) );
5353
});
5454
});
5555
})( jQuery );

0 commit comments

Comments
 (0)