aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/util
diff options
context:
space:
mode:
authorKevin J Hoerr <kjhoerr@protonmail.com>2023-12-24 08:13:33 +0000
committerKevin J Hoerr <kjhoerr@protonmail.com>2023-12-24 08:13:33 +0000
commit1c4c99f0c19f19424e3aee04e868c38333164dd9 (patch)
tree783970ddbd3d1f696493a8b66d9cff6aed533b68 /src/util
parent3bc3700152504ac0ff4f9a42a45ab59cde2e189d (diff)
downloadsubmelon.dev-1c4c99f0c19f19424e3aee04e868c38333164dd9.tar.gz
submelon.dev-1c4c99f0c19f19424e3aee04e868c38333164dd9.tar.bz2
submelon.dev-1c4c99f0c19f19424e3aee04e868c38333164dd9.zip
Generate sitemap.xml, robots.txt
Diffstat (limited to 'src/util')
-rw-r--r--src/util/timestamp.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/timestamp.ts b/src/util/timestamp.ts
index 01b78fb..39683cc 100644
--- a/src/util/timestamp.ts
+++ b/src/util/timestamp.ts
@@ -63,3 +63,10 @@ export function getTimestamp(seconds: number): string {
return dateArr.map(encodeBase62).join(".") + "-0";
}
+
+/**
+ * Returns a date in the ISO-8601 format
+ */
+export function formatDate(date: Date): string {
+ return date.getUTCFullYear() + "-" + (date.getUTCMonth() + 1) + "-" + date.getUTCDate();
+}