DatePipe
Formats a date value according to locale rules.
class DatePipe implements PipeTransform {}
transform
string | number | Date
The date expression: a Date
object, a number
(milliseconds since UTC epoch), or an ISO string (https://www.w3.org/TR/NOTE-datetime).
string | undefined
The date/time components to include, using predefined options or a
custom format string. When not provided, the DatePipe
looks for the value using the
DATE_PIPE_DEFAULT_OPTIONS
injection token (and reads the dateFormat
property).
If the token is not configured, the mediumDate
is used as a value.
string | undefined
A timezone offset (such as '+0430'
). When not provided, the DatePipe
looks for the value using the DATE_PIPE_DEFAULT_OPTIONS
injection token (and reads
the timezone
property). If the token is not configured, the end-user's local system
timezone is used as a value.
string | undefined
A locale code for the locale format rules to use.
When not supplied, uses the value of LOCALE_ID
, which is en-US
by default.
See Setting your app locale.
string | null
null | undefined
string | undefined
string | undefined
string | undefined
null
string | number | Date | null | undefined
string | undefined
string | undefined
string | undefined
string | null