From a9de455c7144753a780dc19596cd498a90826598 Mon Sep 17 00:00:00 2001 From: Spencer Flagg Date: Tue, 5 Jul 2022 12:39:42 +0200 Subject: [PATCH] should be v1.0.5, but version isn't right; styling; new domain; new contact form --- src/_data/buildInfo.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/_data/buildInfo.js diff --git a/src/_data/buildInfo.js b/src/_data/buildInfo.js new file mode 100644 index 0000000..33c3788 --- /dev/null +++ b/src/_data/buildInfo.js @@ -0,0 +1,21 @@ +const packageJson = require('../../package.json'); + +module.exports = () => { + const now = new Date(); + const { timeZone } = Intl.DateTimeFormat().resolvedOptions(); + const buildDate = Intl.DateTimeFormat('fr-CA', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + }).format(now); + const buildTime = Intl.DateTimeFormat('nl-NL', { hour: '2-digit', minute: '2-digit' }).format( + now, + ); + return { + version: packageJson.version, + time: { + raw: now.toISOString(), + formatted: `${buildDate} ${buildTime} ${timeZone}`, + }, + }; +};