Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date picker appears at bottom of page before click #2179

Open
Nicksab82 opened this issue Jul 25, 2023 · 1 comment
Open

Date picker appears at bottom of page before click #2179

Nicksab82 opened this issue Jul 25, 2023 · 1 comment

Comments

@Nicksab82
Copy link

Nicksab82 commented Jul 25, 2023

I am currently using datepicker on my site with the following code:

$(function(){
	$("#attrib-23-0").attr( 'readOnly' , 'true' );
    $('#attrib-23-0').datepicker({ 
	  dateFormat: 'MM dd, yy',
	  beforeShowDay: function(date){
var string = jQuery.datepicker.formatDate('mm/dd/yy', date);
var day = date.getDay();
return [ ( day > 0 && day < 6 && dates.indexOf(string) == -1), "" ];
	}
});
    var dates = ["07/14/2023","2023-07-04", "04-07-2023", "07/05/2023", "07/04/2023","07/06/2023","07/03/2023","07/07/2023"];
	
    var d = new Date();
    var targetTimeOffset  = +6*60; //desired time zone, taken as GMT-4
    d.setMinutes(d.getMinutes() + d.getTimezoneOffset() + targetTimeOffset );
    $( "#attrib-23-0" ).datepicker( "option", "minDate", d );
});

When the page is first accessed, the calendar is displayed at the bottom of the page. Once the input field is clicked, the calendar is displayed correctly and the one at the bottom of the page disappeared.

Is this a known bug ? or is there a way to fix it?

An sample page can be seen here: https://www.royal-fleur.com/all-flowers/above-larkspur-sunset-bouquet

Thank you in advance for the help.

@mgol
Copy link
Member

mgol commented Sep 12, 2023

Thanks for the report. Since the issue is already in 1.12, given limited team resources it's not likely to be fixed by the UI team; see the project status at https://blog.jqueryui.com/2021/10/jquery-maintainers-update-and-transition-jquery-ui-as-part-of-overall-modernization-efforts/. PRs are welcome if they're not too complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants