@jsverse/transloco-locale
Version:
The localization (l10n) library plugin for Transloco
25 lines (24 loc) • 1.26 kB
TypeScript
import { PipeTransform } from '@angular/core';
import { DateFormatOptions, Locale, ValidDate } from '../transloco-locale.types';
import { BaseLocalePipe } from './base-locale.pipe';
import * as i0 from "@angular/core";
export declare class TranslocoDatePipe extends BaseLocalePipe implements PipeTransform {
private localeConfig;
/**
* Transform a date into the locale's date format.
*
* The date expression: a `Date` object, a number
* (milliseconds since UTC epoch), or an ISO string (https://www.w3.org/TR/NOTE-datetime).
*
* @example
*
* date | translocoDate: {} : en-US // 9/10/2019
* date | translocoDate: { dateStyle: 'medium', timeStyle: 'medium' } : en-US // Sep 10, 2019, 10:46:12 PM
* date | translocoDate: { timeZone: 'UTC', timeStyle: 'full' } : en-US // 7:40:32 PM Coordinated Universal Time
* 1 | translocoDate: { dateStyle: 'medium' } // Jan 1, 1970
* '2019-02-08' | translocoDate: { dateStyle: 'medium' } // Feb 8, 2019
*/
transform(date: ValidDate, options?: DateFormatOptions, locale?: Locale): string;
static ɵfac: i0.ɵɵFactoryDeclaration<TranslocoDatePipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<TranslocoDatePipe, "translocoDate", true>;
}