Fix cast exception in dateview

Change-Id: Id6b40e3741a600cef33617369fe85f7fe09c843f