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
commitcc013584714e8ce1f583ce391f8123881e3c0297 (patch)
tree1ba356e34a048e39cc793f6705f5a4f4430bfe31 /deno/base/date.ts
parentfa62ea0367faea62904c0085c029cdbb18cf0857 (diff)
downloadcrupest-cc013584714e8ce1f583ce391f8123881e3c0297.tar.gz
crupest-cc013584714e8ce1f583ce391f8123881e3c0297.tar.bz2
crupest-cc013584714e8ce1f583ce391f8123881e3c0297.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, "-");
+}