I have a simple issue that I don't know how to fix. If I run this code in Chrome:
var event = new Date(Date.UTC(2012, 11, 5, 3, 0, 0));
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
console.log(event.toLocaleDateString('en-US', options));
The result is Tuesday, December 4, 2012
but if I run it in IE11 I get Tuesday, December 04, 2012
.
It seems that IE11 is not conforming to the format argument of day: 'numeric'
and instead acts as if I specified day: '2-digit'
.
So is this just IE11's fault? I couldn't find any discussion of this specific issue online. If it is, how can I work around this to get the formatting I want without the leading 0 on single-digit day numbers?