inputDate undefined fix