update build date format
All checks were successful
deploy / deploy (push) Successful in 5s

This commit is contained in:
Lee 2023-10-18 02:18:09 +01:00
parent 45ad55b0c7
commit 30533d6899
5 changed files with 22 additions and 4 deletions

9
package-lock.json generated

@ -8,6 +8,7 @@
"name": "svelte-app",
"version": "1.0.0",
"dependencies": {
"moment": "^2.29.4",
"sirv-cli": "^1.0.0"
},
"devDependencies": {
@ -1033,6 +1034,14 @@
"dev": true,
"license": "MIT"
},
"node_modules/moment": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
"engines": {
"node": "*"
}
},
"node_modules/mri": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz",

@ -39,6 +39,7 @@
"typescript": "^4.0.0"
},
"dependencies": {
"moment": "^2.29.4",
"sirv-cli": "^1.0.0"
}
}

@ -3,6 +3,7 @@ const path = require("path");
const { execSync } = require("child_process");
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import moment from "moment/moment";
import css from "rollup-plugin-css-only";
import livereload from "rollup-plugin-livereload";
import svelte from "rollup-plugin-svelte";
@ -22,8 +23,7 @@ fs.writeFileSync(
"build-info.js",
"export default " +
JSON.stringify({
buildDate:
new Date().toISOString().substr(0, 19).replace("T", " ") + " UTC",
buildDate: moment().format("MMMM Do YYYY, h:mm:ss a"),
buildVersion,
})
);

@ -1,4 +1,5 @@
<script>
import moment from 'moment';
import { setContext } from 'svelte';
import { Route, Router, navigate } from "svelte-routing";
import buildInfo from '../build-info';
@ -15,12 +16,14 @@
import TwitchPage from './pages/Twitch.svelte';
import createContainerStore from './stores/container';
// When SSR was built (eg: 1 hour ago)
export const buildDateAgo = moment(buildInfo.buildDate, "MMMM Do YYYY, h:mm:ss a").fromNow();
export let url = "";
let mainEl = null;
const containerStore = createContainerStore();
setContext('pageContainer', containerStore);
$: if (mainEl) containerStore.observe(mainEl)
@ -53,7 +56,7 @@
<footer>
<p>ScoreSaber Reloaded by <a href="https://git.fascinated.cc/Fascinated/scoresaber-reloaded">Fascinated & motzel</a></p>
<p class="build">Build: {buildInfo.buildVersion} ({buildInfo.buildDate})</p>
<p class="build" title="{buildDateAgo}">Build: {buildInfo.buildVersion} ({buildInfo.buildDate})</p>
<p>
<a href="/privacy" on:click|preventDefault={() => navigate('/privacy')}>Privacy policy</a> |
<a href="/credits" on:click|preventDefault={() => navigate('/credits')}>Credits</a>

@ -611,6 +611,11 @@ minimist@^1.2.5:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
moment@^2.29.4:
version "2.29.4"
resolved "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz"
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
mri@^1.1.0:
version "1.1.6"
resolved "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz"