I have tried using DatePipe to format date values which I get from REST API. The format of the date string in REST API is like this: Wed Mar 28 12:20:11 IST 2018.
It works fine when the timezone in the string is UTC, EST etc. However it is resulting in below error if the timezone string is IST, CET or some other.
ERROR Error: InvalidPipeArgument: 'Wed Mar 28 12:20:11 IST 2018' for pipe 'DatePipe'
at invalidPipeArgumentError (VM616 common.umd.js:4313)
at DatePipe.transform (VM616 common.umd.js:4495)
at MyPipe.transform (VM1283 my.pipe.ts!transpiled:20)
A sample reproducer is available here: https://plnkr.co/edit/UPNJG9ejpYdkYQivq3cj?p=preview. I tried creating a DatePipe instance as below, but it did not work.
new DatePipe('en-IN')
Could someone please tell me how to add support for timezones which are not supported by default in DatePipe.
Thanks in advance.