The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Rendering an Observable Date with the Async and Date Pipes

Rendering an Observable Date with the Async and Date Pipes

1:05
Instead of simply pushing numbers on a timer into the template, now we'll move on to pushing actual Dates. We'll still use the Async pipe, but we'll also add on the Date pipe with some formatting to display the Date just the way we want it.
Watch this lesson now
Avatar
egghead.io

Instead of simply pushing numbers on a timer into the template, now we'll move on to pushing actual Dates. We'll still use the Async pipe, but we'll also add on the Date pipe with some formatting to display the Date just the way we want it.

Avatar
John Christopher Jones

The date pipe won't work in the current release of Safari as of 2016 June 25. Angular2 will self-immolate and very helpfully tell you that the problem arose in [object Object]. If you're trying to get this to work, you'll need to add the Intl polyfill to your index.html.

  1. Install the Intl package.
install --save intl
  1. Then, for English locale, in your index.html under the other "polyfills" you must already have, add:
<script src="node_modules/intl/dist/Intl.js"></script>
<script src="node_modules/intl/locale-data/jsonp/en.js"></script>
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?