feat(ssr): add update last updated to analytics embed
All checks were successful
deploy / deploy (push) Successful in 2m10s

This commit is contained in:
Lee 2023-11-13 01:10:20 +00:00
parent 426a2b5a2f
commit b42ba1afdd
2 changed files with 5 additions and 3 deletions

@ -4,6 +4,7 @@ import Container from "@/components/Container";
import { ScoresaberMetricsHistory } from "@/schemas/fascinated/scoresaberMetricsHistory";
import ssrSettings from "@/ssrSettings.json";
import { formatNumber } from "@/utils/numberUtils";
import { formatDate } from "@/utils/timeUtils";
import { isProduction } from "@/utils/utils";
import { Metadata } from "next";
import Link from "next/link";
@ -44,8 +45,9 @@ export async function generateMetadata(): Promise<Metadata> {
description:
description +
`
Players currently online: ${formatNumber(lastActivePlayers)}
Last Updated: ${formatDate(new Date().toISOString())}
Players Online Today: ${formatNumber(lastActivePlayers)}
Scores set Today: ${formatNumber(lastScoreCount)}`,
},
};

@ -31,7 +31,7 @@ export function formatTimeAgo(timestamp: string) {
* @param timestamp the timestamp to format
* @returns the formatted timestamp
*/
export function formatDate(timestamp: string) {
export function formatDate(timestamp: any) {
const date = parseISO(timestamp);
return date.toLocaleDateString("en-US", {
year: "numeric",