Skip to content

EXCEPTION: Invalid argument '2017-01-11T09:25:14.014-0500' for pipe 'DatePipe' #13874

Closed

Description

@anrepppp

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
Using date pipe in IE doesn't work it throws an error message in console:
EXCEPTION: Invalid argument '2017-01-11T09:25:14.014-0500' for pipe 'DatePipe'

I have seen there are several open issue regarding date Pipe. But, they are representing the incorrect format. Whereas, the date pipe is not working at all in my case.

Expected behavior
The date pipe show work for:
'2017-01-11T09:25:14.014-0500' | date: 'MM/dd/yyyy hh:mm:ss a'

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Angular version: 2.0.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

Activity

  1. DzmitryShylovich commented on Jan 11, 2017

    @DzmitryShylovich
    Contributor

    @anvesh48
    Open console in IE and try to create a date from your string

    new Date('2017-01-11T09:25:14.014-0500');
    

    it's not a valid date in IE.

  2. added
    area: commonIssues related to APIs in the @angular/common package
    area: i18nIssues related to localization and internationalization
    on Jan 11, 2017
  3. intellix commented on Jan 11, 2017

    @intellix

    Also not a valid date in Safari. Funnily enough neither is this: new Date("2017-01-06 23:07:57")
    Safari is a joke

  4. anrepppp commented on Jan 11, 2017

    @anrepppp
    Author

    @DzmitryShylovich You are right. But angular1 worked with the same date format.

  5. Toxicable commented on Jan 12, 2017

    @Toxicable

    @anvesh48 This isn't Angular1

  6. anrepppp commented on Jan 12, 2017

    @anrepppp
    Author

    @Toxicable Ok, I agree this is not Angular1..!

  7. added a commit that references this issue on Aug 11, 2017
    6c2ba04
  8. added a commit that references this issue on Aug 28, 2017
    ee29d59
  9. angular-automatic-lock-bot commented on Sep 10, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: commonIssues related to APIs in the @angular/common packagearea: i18nIssues related to localization and internationalization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions