added additional check in seleniums for datepicker
(cherry picked from commit 3608ce4)