import { DatePipe } from '@angular/common'; import { Observable, ReplaySubject } from 'rxjs'; import { TranslatePipe } from '../translate'; import * as i0 from "@angular/core"; /** * Date and time spec: https://docs.google.com/document/d/1VNtaS9_jmbcWRqYi3EkCk925rvTP1kczD73cD732-KM * * DATE_FORMAT: * - human: * - format few seconds/minutes ago as relative time like 'Just now' or '10 minutes ago' * - format today/yesterday as human date like 'Today, 8:13AM' * - format date before yesterday like 'Dec 31, 2017' * - numerical: * - format date as numerical date like '12/31/2017' */ export type DateFormat = 'human' | 'numerical'; export declare class StringMap { yesterday: { key: string; value: string; }; fewSecondsAgo: { key: string; value: string; }; oneMinuteAgo: { key: string; value: string; }; minutesAgo: { key: string; value: string; }; at: { key: string; value: string; }; constructor(translateMap?: { [key: string]: string; }); } export declare class DateTimeService { private translate; private locale; strings: ReplaySubject; localeDatePipe: DatePipe; cache: { [key: string]: string | null; }; numericalFormat: string; constructor(translate: TranslatePipe, locale: string); /** * Returns an observable containing the formatted date as a string. * @param timestamp: string representation of a date which can be used with `new Date(timestamp)` * (timestamp coming directly from backend can be used). All timestamp should have a timezone set so final date is correct. * @param format: format to use. * @param dateOnly: false by default * @param displaySeconds: false by default */ getFormattedDate(timestamp: string, format: DateFormat, dateOnly?: boolean, displaySeconds?: boolean): Observable; private getNumericalDate; private getHumanDate; private getFormattedTime; private transform; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }