Handle undefined toISOString() method in uiDateFormat directive.

Handle undefined toISOString() method in uiDateFormat directive. Currently errors when user typing in date value in input using uiDate.