I use:
body.modal-open .datepicker {
z-index: 1200 !important;
}
This way: if the modal isn't open, and you want the datepicker to be at the normal z-index (in my case I needed it to be under the menu drop-down, which has a z-index of 1000), it works.
If the modal is open, the datepicker needs to be over the modal z-index (1040 or 1050), so use the body.modal-open
selector.
I'm using Bootstrap 3.1.1