Fix invalid dates being generated in IE10