diff --git a/app/Views/sales/activity_view.php b/app/Views/sales/activity_view.php
index cd37c11c..22584f0d 100644
--- a/app/Views/sales/activity_view.php
+++ b/app/Views/sales/activity_view.php
@@ -767,10 +767,7 @@ async function fetchActivities(isLoadMore = false) {
.sort((a, b) => Number(b.activity_id) - Number(a.activity_id))
.map(a => {
let formattedCreatedDate = a.created_at
- ? new Date(a.created_at).toLocaleString('en-US', {
- month: 'short', day: 'numeric', year: 'numeric',
- hour: '2-digit', minute: '2-digit', hour12: true
- })
+ ? formatIndianDate(a.created_at)
: 'N/A';
let displayNote = 'N/A';
@@ -910,14 +907,7 @@ function renderCard(opps) {
let opp_status_value = o.status?.replace(/[-_']/g, ' ').toUpperCase();
- let formattedDate = new Date(o.created_at).toLocaleString('en-US', {
- month: 'short',
- day: 'numeric',
- year: 'numeric',
- hour: '2-digit',
- minute: '2-digit',
- hour12: true
- });
+ let formattedDate = formatIndianDate(o.created_at);
// ${o.client_short_name}
return `
@@ -971,14 +961,7 @@ function renderTimeline(acts) {
const icon = activityIcons[a.activity_type] || "";
const formattedType = a.activity_type?.toUpperCase() || "";
- const formattedDate = new Date(a.scheduled_date).toLocaleString('en-US', {
- month: 'short',
- day: 'numeric',
- year: 'numeric',
- hour: '2-digit',
- minute: '2-digit',
- hour12: true
- });
+ const formattedDate = formatIndianDate(a.scheduled_date);
// Then use the variable in your HTML:
//
${formattedDate}
@@ -1406,14 +1389,16 @@ function formatIndianDate(value) {
const date = new Date(String(value).replace(' ', 'T'));
if (Number.isNaN(date.getTime())) return value;
- return date.toLocaleString('en-IN', {
- day: '2-digit',
- month: '2-digit',
- year: 'numeric',
- hour: '2-digit',
- minute: '2-digit',
- hour12: true
- }).replace(',', '').toUpperCase();
+ const day = String(date.getDate()).padStart(2, '0');
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const year = date.getFullYear();
+ let hours = date.getHours();
+ const minutes = String(date.getMinutes()).padStart(2, '0');
+ const seconds = String(date.getSeconds()).padStart(2, '0');
+ const ampm = hours >= 12 ? 'PM' : 'AM';
+ hours = hours % 12 || 12;
+
+ return `${day}/${month}/${year} ${String(hours).padStart(2, '0')}:${minutes}:${seconds} ${ampm}`;
}
function downloadCsv(filename, rows) {
@@ -1473,7 +1458,7 @@ function initActivityExportDateRangePicker() {
opens: 'left',
drops: 'down',
locale: {
- format: 'DD-MM-YYYY',
+ format: 'DD/MM/YYYY',
applyLabel: 'Generate Excel',
cancelLabel: 'Cancel'
},
diff --git a/app/Views/sales/tracker_view.php b/app/Views/sales/tracker_view.php
index 52025e51..2abf7177 100644
--- a/app/Views/sales/tracker_view.php
+++ b/app/Views/sales/tracker_view.php
@@ -1176,10 +1176,7 @@ async function fetchLeads(isLoadMore = false) {
.sort((a, b) => Number(b.lead_id) - Number(a.lead_id))
.map(l => {
let formattedCreatedDate = l.created_at
- ? new Date(l.created_at).toLocaleString('en-US', {
- month: 'short', day: 'numeric', year: 'numeric',
- hour: '2-digit', minute: '2-digit', hour12: true
- })
+ ? formatIndianDate(l.created_at)
: 'N/A';
return `
@@ -1308,14 +1305,7 @@ function renderCard(opps) {
- let formattedDate = new Date(o.created_at).toLocaleString('en-US', {
- month: 'short',
- day: 'numeric',
- year: 'numeric',
- hour: '2-digit',
- minute: '2-digit',
- hour12: true
- });
+ let formattedDate = formatIndianDate(o.created_at);
// ${o.client_short_name}
return `
@@ -1368,14 +1358,7 @@ function renderTimeline(acts) {
const icon = activityIcons[a.activity_type] || "";
const formattedType = a.activity_type?.toUpperCase() || "";
- const formattedDate = new Date(a.scheduled_date).toLocaleString('en-US', {
- month: 'short',
- day: 'numeric',
- year: 'numeric',
- hour: '2-digit',
- minute: '2-digit',
- hour12: true
- });
+ const formattedDate = formatIndianDate(a.scheduled_date);
// Then use the variable in your HTML:
//
${formattedDate}
@@ -2568,14 +2551,16 @@ function formatIndianDate(value) {
const date = new Date(String(value).replace(' ', 'T'));
if (Number.isNaN(date.getTime())) return value;
- return date.toLocaleString('en-IN', {
- day: '2-digit',
- month: '2-digit',
- year: 'numeric',
- hour: '2-digit',
- minute: '2-digit',
- hour12: true
- }).replace(',', '').toUpperCase();
+ const day = String(date.getDate()).padStart(2, '0');
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const year = date.getFullYear();
+ let hours = date.getHours();
+ const minutes = String(date.getMinutes()).padStart(2, '0');
+ const seconds = String(date.getSeconds()).padStart(2, '0');
+ const ampm = hours >= 12 ? 'PM' : 'AM';
+ hours = hours % 12 || 12;
+
+ return `${day}/${month}/${year} ${String(hours).padStart(2, '0')}:${minutes}:${seconds} ${ampm}`;
}
function downloadCsv(filename, rows) {
@@ -2635,7 +2620,7 @@ function initLeadExportDateRangePicker() {
opens: 'left',
drops: 'down',
locale: {
- format: 'DD-MM-YYYY',
+ format: 'DD/MM/YYYY',
applyLabel: 'Generate Excel',
cancelLabel: 'Cancel'
},
diff --git a/app/Views/view_rfq.php b/app/Views/view_rfq.php
index 7296c61f..2a88995d 100644
--- a/app/Views/view_rfq.php
+++ b/app/Views/view_rfq.php
@@ -887,17 +887,17 @@
- " required>
+ " required>
- " required>
+ " required>
- ">
+ ">