From 6771a6a061615c7a6de2b21d97e338d8a70b5021 Mon Sep 17 00:00:00 2001 From: LuukvH Date: Mon, 15 Jul 2024 22:10:40 +0200 Subject: [PATCH] refactor: Extract format date logic Extract date formatting to separate function. --- src/web/src/utils/formatDate.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/web/src/utils/formatDate.ts diff --git a/src/web/src/utils/formatDate.ts b/src/web/src/utils/formatDate.ts new file mode 100644 index 0000000..e0d3eba --- /dev/null +++ b/src/web/src/utils/formatDate.ts @@ -0,0 +1,3 @@ +import dayjs from "dayjs"; + +export const formatDate = (value: string) => value && dayjs(value).format("L");