diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53b2c0847..aff4237ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,6 @@ jobs: uses: nanzm/get-time-action@v1.1 with: timeZone: 8 - format: 'YYYY-MM-DD HH:mm:ss' - name: Build the Docker image env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 766d8258a..ee8894de2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,6 @@ jobs: uses: nanzm/get-time-action@v1.1 with: timeZone: 8 - format: 'YYYY-MM-DD_HH:mm:ss' - name: Build and publish Docker Image to GitHub Packages Registry id: publish diff --git a/GZCTF/ClientApp/src/pages/About.tsx b/GZCTF/ClientApp/src/pages/About.tsx index 70a7a3f62..8cf45a0c0 100644 --- a/GZCTF/ClientApp/src/pages/About.tsx +++ b/GZCTF/ClientApp/src/pages/About.tsx @@ -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], @@ -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 ( @@ -77,7 +81,7 @@ const About: FC = () => { color="dimmed" sx={(theme) => ({ fontFamily: theme.fontFamilyMonospace })} > - {`built at ${timestamp.replaceAll('_', ' ')}`} + {`built at ${dateTimeFormat.format(builtdate)}`}