Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
DatePipe doesn't support local Dates in Safari #17576
I'm submitting a ...
There are lots of issues floating around with internationalization and the DatePipe itself but I couldn't find mention of this. Safari 10 isn't supposed to need it but I tried the Intl polyfill and it doesn't seem to affect anything.
DatePipe formats days off by one, different depending on timezone. Testing by changing my OS timezone, I see that far west timezones like Pacific are fine, eastern hemisphere zones break every date, my Central daylight zone has issues with certain dates.
Formatted date should match input.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Please tell us about your environment
see : Documentation Mozilla
There is a third argument to the date pipe (which is not documented yet, it will be once I've removed the intl api) that you can use to set the timezone of the date. For example use "+0100" to set the timezone to GMT+1. Otherwise the date will be shown based on the timezone of the browser.
Does it fix your problem?
Because it has a lot of issues that we cannot fix: inconsistencies between browsers, missing features, missing api (in some browsers, which means a polyfill that we don't control either), ... The API is just too immature to be used in Angular.