1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Using format.js

https://github.com/tooot-app/app/issues/280
This commit is contained in:
Zhiyuan Zheng
2022-05-08 17:56:26 +02:00
parent edb332bb26
commit 4c9f93497d
17 changed files with 270 additions and 156 deletions

View File

@ -15,6 +15,7 @@ import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useCallback, useEffect, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { FormattedRelativeTime } from 'react-intl'
import { Dimensions, Platform, Pressable, StyleSheet, View } from 'react-native'
import { Circle } from 'react-native-animated-spinkit'
import FastImage from 'react-native-fast-image'
@ -91,7 +92,17 @@ const ScreenAnnouncements: React.FC<
>
<Trans
i18nKey='screenAnnouncements:content.published'
components={[<RelativeTime date={item.published_at} />]}
components={[
<FormattedRelativeTime
value={
-(
new Date().getTime() -
new Date(item.published_at).getTime()
) / 1000
}
updateIntervalInSeconds={1}
/>
]}
/>
</CustomText>
<ScrollView