Skip to content

Commit

Permalink
[Footer] Update timestamp format and add release version
Browse files Browse the repository at this point in the history
  • Loading branch information
rikurauhala committed Nov 19, 2024
1 parent 1bdbec9 commit b173e27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions services/frontend/src/components/material/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Box, Container, Divider, Stack, Typography } from '@mui/material'

import { isDefaultServiceProvider } from '@/common'
import { builtAt, dataProtectionUrl, licenseUrl, sourceCodeUrl } from '@/conf'
import { DISPLAY_DATE_FORMAT } from '@/constants/date'
import { builtAt, dataProtectionUrl, licenseUrl, sentryRelease, sourceCodeUrl } from '@/conf'
import { DISPLAY_DATETIME_FORMAT } from '@/constants/date'
import { reformatDate } from '@/util/timeAndDate'
import { ExternalLink } from './ExternalLink'
import { InternalLink } from './InternalLink'
Expand Down Expand Up @@ -38,7 +38,10 @@ export const Footer = () => {
<Typography variant="subtitle1">Build</Typography>
<InternalLink href="/changelog" text="Changelog" />
<Typography color="text.secondary" variant="body2">
Updated on {reformatDate(builtAt || new Date().toISOString(), DISPLAY_DATE_FORMAT)}
Updated {reformatDate(builtAt || new Date().toISOString(), DISPLAY_DATETIME_FORMAT)}
</Typography>
<Typography color="text.secondary" variant="body2">
Version {sentryRelease || 'dev'}
</Typography>
</Stack>
</Stack>
Expand Down
1 change: 1 addition & 0 deletions services/frontend/src/constants/date.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// TODO: Replace with an enum

export const DISPLAY_DATE_FORMAT = 'DD.MM.YYYY'
export const DISPLAY_DATETIME_FORMAT = 'DD.MM.YYYY HH:mm'
export const DISPLAY_DATE_FORMAT_DEV = 'DD.MM.YYYY HH:mm:ss'
export const LONG_DATE_TIME_FORMAT = 'D MMMM YYYY [at] HH:mm:ss'
export const ISO_DATE_FORMAT = 'YYYY-MM-DD'
Expand Down

0 comments on commit b173e27

Please sign in to comment.