From 6aa809177437a82d3c904dde3de435c8b2794b88 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Jan 2026 11:05:21 +0530 Subject: [PATCH] UAE added --- app/controllers/submission.controller.js | 36 +++++++++++++----------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/app/controllers/submission.controller.js b/app/controllers/submission.controller.js index 5b911fc..e6848de 100644 --- a/app/controllers/submission.controller.js +++ b/app/controllers/submission.controller.js @@ -205,17 +205,18 @@ exports.createSubmission = async (req, res) => { const AdminUsersData = await User.findAll({where: { is_active: 1 }}); const formatSubmissionDate = (date) => { - return new Intl.DateTimeFormat("en-GB", { - day: "2-digit", - month: "short", - year: "numeric", - hour: "2-digit", - minute: "2-digit", - hour12: true, - timeZone: "Asia/Dubai", - timeZoneName: "short" - }).format(new Date(date)) - .replace("GMT+4", "GST (UAE)"); + const formatted = new Intl.DateTimeFormat("en-GB", { + day: "2-digit", + month: "short", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + hour12: true, + timeZone: "Asia/Dubai" + }).format(new Date(date)); + const [datePart, timePart] = formatted.split(", "); + const upperTime = timePart.toUpperCase(); + return `${datePart}, ${upperTime} GST (UAE)`; }; // Shared placeholder data @@ -818,8 +819,8 @@ exports.approveOrRejectSubmission = async (req, res) => { for await (const userObj of EstablishmentUserData) { - function formatSubmissionDate(date) { - return new Intl.DateTimeFormat("en-GB", { + const formatSubmissionDate = (date) => { + const formatted = new Intl.DateTimeFormat("en-GB", { day: "2-digit", month: "short", year: "numeric", @@ -827,10 +828,11 @@ exports.approveOrRejectSubmission = async (req, res) => { minute: "2-digit", hour12: true, timeZone: "Asia/Dubai" - }) - .format(new Date(date)) - .replace(",", "") + " GST (UAE)"; - } + }).format(new Date(date)); + const [datePart, timePart] = formatted.split(", "); + const upperTime = timePart.toUpperCase(); + return `${datePart}, ${upperTime} GST (UAE)`; + }; placeHolderData = { user_name: sanitizeForLog(userObj.name),