aboutsummaryrefslogtreecommitdiff
path: root/deno/base/date.ts
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-06-05 22:30:51 +0800
committerYuqian Yang <crupest@crupest.life>2025-06-09 21:48:00 +0800
commit3bdca0b90cf8bf5dfd6ff1ab482d857abb4acd2d (patch)
tree42fd1bf1f0119910c09542fbf475c012404658fd /deno/base/date.ts
parent543fc733da074751e1750603df6931089efab465 (diff)
downloadcrupest-3bdca0b90cf8bf5dfd6ff1ab482d857abb4acd2d.tar.gz
crupest-3bdca0b90cf8bf5dfd6ff1ab482d857abb4acd2d.tar.bz2
crupest-3bdca0b90cf8bf5dfd6ff1ab482d857abb4acd2d.zip
feat(deno): move deno (mail-server) to top level.
Diffstat (limited to 'deno/base/date.ts')
-rw-r--r--deno/base/date.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/deno/base/date.ts b/deno/base/date.ts
new file mode 100644
index 0000000..e65691e
--- /dev/null
+++ b/deno/base/date.ts
@@ -0,0 +1,6 @@
+export function toFileNameString(date: Date, dateOnly?: boolean): string {
+ const str = date.toISOString();
+ return dateOnly === true
+ ? str.slice(0, str.indexOf("T"))
+ : str.replaceAll(/:|\./g, "-");
+}