chrisnelsoncentare/jquery-mobile-datebox — comment on commit 883f0f6f49f3809e7c7eaad63af54829fea8f7d5
File: js/jquery.mobile.datebox.js line 2181
By chrisnelsoncentare:

In summary, if the full popup can show without a part of it being out of sight, it will be centered over the input. If any part of it ends up being off screen, it is shifted up/down so that it fully appears.