Adds playback bar to story viewer
This commit is contained in:
parent
9817946afc
commit
85c8ff76dc
17 changed files with 291 additions and 125 deletions
|
@ -103,7 +103,8 @@ export function formatDateTimeLong(
|
|||
export function formatTime(
|
||||
i18n: LocalizerType,
|
||||
rawTimestamp: RawTimestamp,
|
||||
now: RawTimestamp
|
||||
now: RawTimestamp,
|
||||
isRelativeTime?: boolean
|
||||
): string {
|
||||
const timestamp = rawTimestamp.valueOf();
|
||||
const diff = now.valueOf() - timestamp;
|
||||
|
@ -116,6 +117,10 @@ export function formatTime(
|
|||
return i18n('minutesAgo', [Math.floor(diff / MINUTE).toString()]);
|
||||
}
|
||||
|
||||
if (isRelativeTime) {
|
||||
return i18n('hoursAgo', [Math.floor(diff / HOUR).toString()]);
|
||||
}
|
||||
|
||||
return new Date(timestamp).toLocaleTimeString([], {
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue