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

What is the proper way to set datepicker orientation? #561

Closed
first-developer opened this Issue Jul 26, 2013 · 6 comments

Comments

Projects
None yet
7 participants
@first-developer

first-developer commented Jul 26, 2013

Hi I tried to use the 'orientation' option of the datepicker but it doesn't seem to work.

$(".datepicker").datepicker({
  orientation: "right bottom"
});

Thanks in advance

@eternicode

This comment has been minimized.

Contributor

eternicode commented Jul 27, 2013

"right bottom" should result in the picker showing upward and to the left from the element (the "tooth" that points to the element should be to the bottom-right of the picker).

@eternicode eternicode closed this Aug 18, 2013

@neverfox

This comment has been minimized.

neverfox commented Jun 9, 2014

That's a bit counter-intuitive, isn't it? The first thing that comes to mind for me is that it's the orientation of the calendar relative to the element, not the element relative to the calendar.

@kshipp

This comment has been minimized.

kshipp commented May 8, 2015

Yes, it's backwards! "Bottom" really means "top". Please, please fix this.

@Nikola-K

This comment has been minimized.

Nikola-K commented Aug 27, 2015

Just stumbled upon this after trying to figure out what's wrong, I agree that it makes more sense for "top" to show the picker, well, on top of the element and not on the bottom.

At the very least the docs should show an example with both code and pictures examples on how to properly use the orientation.

@snaits

This comment has been minimized.

snaits commented Sep 14, 2016

@tineyi it has a duplicate, which is fixed: #1406

@vinodv3

This comment has been minimized.

vinodv3 commented Jun 16, 2018

it's working ......
$(document).ready(function(){
var date_input=$('input[name="date"]'); //our date input has the name "date"
var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
date_input.datepicker({
format: 'mm/dd/yyyy',
container: container,
todayHighlight: true,
autoclose: true,
orientation: "left top",
})
})

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