Ionic 3 - Using DatePipe in HandleBars


#1

Hi everyone, very trivial question but I am trying to format a date using Angular2 Date Pipe in my html template as follows:

{{record.notification_date| date:'shortDate'}}

This throws an error.

Error: Uncaught (in promise): ReferenceError: Can't find variable: Intl
intlDateFormat@http://localhost:8100/build/main.js:43078:20
http://localhost:8100/build/main.js:43139:59

I’ve read the forums to import datePipe into my component like so:

import { Component, DatePipe } from '@angular/core';

But I get the error that there is no exported member. Has anyone else run into this? Appreciate any help


#2

Did you try include Intl polyfill in app?

npm install intl


#3

Thanks for the reply. No I haven’t tried to use polyfill. Once installed how would I use it?