Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change side that bootstrap-datepicker opens from?

I'm checking out bootstrap-datepicker and would like to customize it a little. Is it possible for the calendar to open from the right side of the input box and right aligned with the input box? Right now by default it always open left aligned with the input field.

The reason I need it to be right aligned is because I'm using it in a mobile app and with the input on the right half of the screen the calendar runs off the screen.

Thanks.

like image 851
Dev01 Avatar asked Mar 20 '23 17:03

Dev01


2 Answers

you could try to specify over this setting "orientation"

 $('#sandbox-container input').datepicker({
    orientation: "auto right"
});

http://bit.ly/1bj5HSD

like image 65
Roman Gural Avatar answered Apr 25 '23 16:04

Roman Gural


This worked for me.

$('#sandbox-container input').daterangepicker({
  opens: 'right'
});
like image 21
Rosalia Fernandez Avatar answered Apr 25 '23 17:04

Rosalia Fernandez