calendar visible hours shows invalid dates(week/day view) (#12521)

Fix: test fails on phantomJs.

Change-Id: I70179c249a180a795e14683e4185068d5395762b