mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
format last fetched at as date + time
This commit is contained in:
parent
7ceb96a93e
commit
40f681db2e
2 changed files with 10 additions and 2 deletions
|
|
@ -24,3 +24,11 @@ export function formattedShortTime(rawDate: string): string {
|
|||
timeZone,
|
||||
}).format(new Date(rawDate))
|
||||
}
|
||||
|
||||
export function formattedDateTime(rawDate: string): string {
|
||||
return new Intl.DateTimeFormat(locale, {
|
||||
dateStyle: 'short',
|
||||
timeStyle: 'short',
|
||||
timeZone,
|
||||
}).format(new Date(rawDate))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
SettingsTableRow,
|
||||
} from '../../../components/templates/settings/SettingsTable'
|
||||
import { theme } from '../../../components/tokens/stitches.config'
|
||||
import { formattedShortTime } from '../../../lib/dateFormatting'
|
||||
import { formattedDateTime } from '../../../lib/dateFormatting'
|
||||
import { unsubscribeMutation } from '../../../lib/networking/mutations/unsubscribeMutation'
|
||||
import { updateSubscriptionMutation } from '../../../lib/networking/mutations/updateSubscriptionMutation'
|
||||
import {
|
||||
|
|
@ -155,7 +155,7 @@ export default function Rss(): JSX.Element {
|
|||
{`URL: ${subscription.url}, `}
|
||||
{`Last fetched: ${
|
||||
subscription.lastFetchedAt
|
||||
? formattedShortTime(subscription.lastFetchedAt)
|
||||
? formattedDateTime(subscription.lastFetchedAt)
|
||||
: 'Never'
|
||||
}`}
|
||||
</StyledText>
|
||||
|
|
|
|||
Loading…
Reference in a new issue