MCPcopy Index your code
hub / github.com/angular/angular / transform

Method transform

packages/common/src/pipes/date_pipe.ts:263–279  ·  view source on GitHub ↗
(
    value: Date | string | number | null | undefined,
    format?: string,
    timezone?: string,
    locale?: string,
  )

Source from the content-addressed store, hash-verified

261 locale?: string,
262 ): string | null;
263 transform(
264 value: Date | string | number | null | undefined,
265 format?: string,
266 timezone?: string,
267 locale?: string,
268 ): string | null {
269 if (value == null || value === '' || value !== value) return null;
270
271 try {
272 const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;
273 const _timezone =
274 timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined;
275 return formatDate(value, _format, locale || this.locale, _timezone);
276 } catch (error) {
277 throw invalidPipeArgumentError(DatePipe, (error as Error).message);
278 }
279 }
280}

Callers

nothing calls this directly

Calls 2

formatDateFunction · 0.90
invalidPipeArgumentErrorFunction · 0.90

Tested by

no test coverage detected