File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
packages/element-web-module-api Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ export interface ExtrasApi {
173173
174174// @public
175175export interface I18nApi {
176+ humanizeTime(timeMillis : number ): string ;
176177 get language(): string ;
177178 register(translations : Partial <Translations >): void ;
178179 translate(key : keyof Translations , variables ? : Variables ): string ;
Original file line number Diff line number Diff line change @@ -49,4 +49,11 @@ export interface I18nApi {
4949 * @param variables - Optional variables to interpolate into the translation
5050 */
5151 translate ( key : keyof Translations , variables ?: Variables ) : string ;
52+
53+ /**
54+ * Convert a timestamp into a translated, human-readable time,
55+ * using the current system time as a reference, eg. "5 minutes ago".
56+ * @param timeMillis - The time in milliseconds since epoch
57+ */
58+ humanizeTime ( timeMillis : number ) : string ;
5259}
You can’t perform that action at this time.
0 commit comments