From c907abeba32f7836848b455da94a920875c4a4c1 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 17 Nov 2022 08:16:17 +0000 Subject: [PATCH] Move file date formatting to the server --- src/utils/helpers/fileHelpers.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/helpers/fileHelpers.js b/src/utils/helpers/fileHelpers.js index ae15d0e..c1e1fbf 100644 --- a/src/utils/helpers/fileHelpers.js +++ b/src/utils/helpers/fileHelpers.js @@ -1,5 +1,6 @@ import ffprobe from "ffprobe"; import ffprobeStatic from "ffprobe-static"; +import moment from "moment/moment"; import path from "path"; import UserModel from "src/models/UserModel"; import { FILE_STORAGE_LOCATION } from "../../consts/filePaths"; @@ -52,6 +53,7 @@ export async function getFileInfo(fileId, isInternal = false) { file.uploader = uploader; file._id = undefined; file.__v = undefined; + file.uploadDate = moment(file.uploadDate).format("MMMM Do YYYY, h:mm:ss a"); file.isImage = file.contentType.includes("image"); file.isVideo = file.contentType.includes("video"); file.fileUrl =