Fix issue with invalid date on ios7 safari