add short time back to the build info
All checks were successful
Deploy SSR / deploy (push) Successful in 1m12s

This commit is contained in:
Lee 2024-09-13 21:19:59 +01:00
parent c3e8b0869e
commit 4b4e7f7f31
3 changed files with 12 additions and 2 deletions

@ -1,6 +1,8 @@
import nextBuildId from "next-build-id";
import path from 'path';
import { fileURLToPath } from 'url';
import {format} from '@formkit/tempo'
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
const __dirname = path.dirname(__filename); // get the name of the directory
@ -16,8 +18,14 @@ const nextConfig = {
hour: "numeric",
minute: "numeric",
timeZoneName: "short",
}),
NEXT_PUBLIC_BUILD_TIME_SHORT: format(new Date(), {
date: "short",
time: "short",
})
}
};
console.log(`NEXT_PUBLIC_BUILD_TIME_SHORT: ${nextConfig.env.NEXT_PUBLIC_BUILD_TIME_SHORT}`);
export default nextConfig;

@ -26,6 +26,7 @@ export function getBuildInformation() {
: "dev"
: "";
const buildTime = process.env.NEXT_PUBLIC_BUILD_TIME;
const buildTimeShort = process.env.NEXT_PUBLIC_BUILD_TIME_SHORT;
return { buildId, buildTime };
return { buildId, buildTime, buildTimeShort };
}

@ -18,12 +18,13 @@ const items: NavbarItem[] = [
];
export default function Footer() {
const { buildId, buildTime } = getBuildInformation();
const { buildId, buildTime, buildTimeShort } = getBuildInformation();
return (
<div className="flex items-center w-full flex-col gap-1 mt-6">
<p className="text-input text-sm">
Build: {buildId} <span className="hidden lg:block">({buildTime})</span>
<span className="none lg:hidden">({buildTimeShort})</span>
</p>
<div className="h-14 w-full flex flex-wrap items-center justify-center bg-secondary/95 divide-x divide-input">
{items.map((item, index) => {