New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DatePipe Error only on Safari #17575
Comments
It's not an Angular Issue but a behavior different between browsers. If you use this pattern, it's work : new Date('2015-02-26T14:10:43+01:00'); See this link for more details |
As @wKoza said, if you use a string instead of a date, it has to follow the ISO8601 spec. |
Just providing my two cents as I've been fighting this issue for a while. The date I'm retrieving is formatted as such Both Safari & IE11 return errors when I try to format it using the below code.
The way I resolved it ( yet to be tested on IE11 ) is below. Component
Template
Hope this helps |
I resolved the same issue by adding a custom pipe to convert the date-time string into date object and then the date pipe works as expected. Component
Template
Here is the
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ...
Current behavior
I am using the Angular DatePipe to format my dates I am getting from an API call, but it doesn't work only on Safari. It works as expected on every other browser. Here is the Error that I am getting.
Expected behavior
<p>{{ item.date | date:'MMM dd' }}</p>
I expect it t transfrom a string like this '2015-02-26 14:10:43' into Feb 26
This happens without any issues in other browsers.
Minimal reproduction of the problem with instructions
Set a date variable to '2015-02-26 14:10:43' and try to transform it using DatePipe using the following example.
<p>{{ item.date | date:'MMM dd' }}</p>
Please tell us about your environment
The text was updated successfully, but these errors were encountered: