Skip to content

Commit

Permalink
chore: improve built time
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjunyu19 committed Jul 29, 2022
1 parent 4dc8656 commit 916aa69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
uses: nanzm/[email protected]
with:
timeZone: 8
format: 'YYYY-MM-DD HH:mm:ss'

- name: Build the Docker image
env:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
uses: nanzm/[email protected]
with:
timeZone: 8
format: 'YYYY-MM-DD_HH:mm:ss'

- name: Build and publish Docker Image to GitHub Packages Registry
id: publish
Expand Down
8 changes: 6 additions & 2 deletions GZCTF/ClientApp/src/pages/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import LogoHeader from '../components/LogoHeader'
import WithNavBar from '../components/WithNavbar'
import MainIcon from '../components/icon/MainIcon'

const MODULE_LOAD_DATE = new Date()
const dateTimeFormat = new Intl.DateTimeFormat(undefined, { dateStyle: 'long', timeStyle: 'long' })

const useStyles = createStyles((theme) => ({
brand: {
color: theme.colors[theme.primaryColor][4],
Expand All @@ -13,7 +16,8 @@ const useStyles = createStyles((theme) => ({
const About: FC = () => {
const sha = import.meta.env.VITE_APP_GIT_SHA ?? '000000'
const tag = import.meta.env.VITE_APP_GIT_NAME ?? 'develop'
const timestamp = import.meta.env.VITE_APP_BUILD_TIMESTAMP ?? '2022-07-23_12:00:00'
const timestamp = import.meta.env.VITE_APP_BUILD_TIMESTAMP ?? '2022-07-23T12:00:00+08:00'
const builtdate = import.meta.env.DEV ? MODULE_LOAD_DATE : new Date(timestamp)
const { classes } = useStyles()

return (
Expand Down Expand Up @@ -77,7 +81,7 @@ const About: FC = () => {
color="dimmed"
sx={(theme) => ({ fontFamily: theme.fontFamilyMonospace })}
>
{`built at ${timestamp.replaceAll('_', ' ')}`}
{`built at ${dateTimeFormat.format(builtdate)}`}
</Text>
</Group>
</Stack>
Expand Down

0 comments on commit 916aa69

Please sign in to comment.