Netanel Basal

Dates are an integral part of almost every application. Angular provides a date pipe out-of-the-box. The date pipe allows users to convert dates according to predefined or custom Angular date formats. For example:

Using it today is disadvantageous because we load a bunch of code when we can probably achieve the same functionality natively. The Intl.DateTimeFormat API can be used unless there is a special use-case you need that is only supported by Angular.

Let’s use that as the basis for a date pipe:

It can be customized to meet your needs. It supports timezones, locales, and custom formats, among other features.

--

--

Netanel Basal

Netanel Basal

A FrontEnd Tech Lead, blogger, and open source maintainer. The founder of ngneat, husband and father.