From 28eddbbe91737008ccb36ea177418a675e9196d2 Mon Sep 17 00:00:00 2001 From: ofri Date: Sun, 1 May 2011 00:45:38 +0300 Subject: [PATCH 1/2] resolve issue #1542 by invoking prevDp with all arguments passed to datepicker --- experiments/ui-datepicker/jquery.ui.datepicker.mobile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js b/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js index 9649cc6539b..4ba96f4d9e5 100644 --- a/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js +++ b/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js @@ -15,7 +15,7 @@ var dp = this; //call cached datepicker plugin - prevDp.call( this, options ); + prevDp.apply( this, arguments ); //extend with some dom manipulation to update the markup for jQM //call immediately @@ -52,4 +52,4 @@ $(this).after( $( "
" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) ); }); }); -})( jQuery ); \ No newline at end of file +})( jQuery ); From 41a0cd3be672c61d9dfd80b0447343c3b4b204ec Mon Sep 17 00:00:00 2001 From: ofri Date: Sun, 1 May 2011 01:38:58 +0300 Subject: [PATCH 2/2] make datepicker use given 'value' of date input as initial value, instead of always using today --- experiments/ui-datepicker/jquery.ui.datepicker.mobile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js b/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js index 4ba96f4d9e5..0ea52ebc34b 100644 --- a/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js +++ b/experiments/ui-datepicker/jquery.ui.datepicker.mobile.js @@ -49,7 +49,7 @@ //bind to pagecreate to automatically enhance date inputs $( ".ui-page" ).live( "pagecreate", function(){ $( "input[type='date'], input:jqmData(type='date')" ).each(function(){ - $(this).after( $( "
" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) ); + $(this).after( $( "
" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true, defaultDate: $(this).val() }) ); }); }); })( jQuery );