Window edge detection/handling

A fix for this: https://github.com/tarruda/bootstrap-datetimepicker/issues/69