CHANGE_THE_DATE_FORMAT
This commit is contained in:
parent
03aca3465e
commit
f09b5433cf
@ -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 `
|
||||
<div class="opportunities-list" id="leadOpportunitiesList">
|
||||
@ -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:
|
||||
// <span style="font-size:11px; color:#999">${formattedDate}</span>
|
||||
@ -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'
|
||||
},
|
||||
|
||||
@ -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 `
|
||||
<div class="opportunities-list" id="leadOpportunitiesList">
|
||||
@ -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:
|
||||
// <span style="font-size:11px; color:#999">${formattedDate}</span>
|
||||
@ -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'
|
||||
},
|
||||
|
||||
@ -887,17 +887,17 @@
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_start_date">Policy Start Date <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="policy_start_date" name="policy_start_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['policy_start_date']) ? date('d-m-Y', strtotime($lead_data['policy_start_date'])) : "" ?>" required>
|
||||
<input type="text" class="form-control" id="policy_start_date" name="policy_start_date" placeholder="DD/MM/YYYY" value="<?= isset($lead_data['policy_start_date']) ? date('d/m/Y', strtotime($lead_data['policy_start_date'])) : "" ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_end_date">Policy End Date <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="policy_end_date" name="policy_end_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['policy_end_date']) ? date('d-m-Y', strtotime($lead_data['policy_end_date'])) : "" ?>" required>
|
||||
<input type="text" class="form-control" id="policy_end_date" name="policy_end_date" placeholder="DD/MM/YYYY" value="<?= isset($lead_data['policy_end_date']) ? date('d/m/Y', strtotime($lead_data['policy_end_date'])) : "" ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="placement_date">Placement Date</label>
|
||||
<input type="text" class="form-control" id="placement_date" name="placement_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['placement_date']) ? date('d-m-Y', strtotime($lead_data['placement_date'])) : "" ?>">
|
||||
<input type="text" class="form-control" id="placement_date" name="placement_date" placeholder="DD/MM/YYYY" value="<?= isset($lead_data['placement_date']) ? date('d/m/Y', strtotime($lead_data['placement_date'])) : "" ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
@ -945,7 +945,7 @@
|
||||
<?php if (isset($lead_data['is_installment']) && $lead_data['is_installment'] == 0 || !isset($lead_data['is_installment'])) { ?>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="payment_date">Payment Date</label>
|
||||
<input type="text" class="form-control payment_date" id="payment_date" name="payment_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['payment_date']) ? date('d-m-Y', strtotime($lead_data['payment_date'])) : "" ?>">
|
||||
<input type="text" class="form-control payment_date" id="payment_date" name="payment_date" placeholder="DD/MM/YYYY" value="<?= isset($lead_data['payment_date']) ? date('d/m/Y', strtotime($lead_data['payment_date'])) : "" ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
@ -1327,22 +1327,22 @@
|
||||
const editor2 = Jodit.make("#internal_mail_content", editorConfig);
|
||||
|
||||
var placement_date_datePicker = flatpickr("#placement_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
dateFormat: "d/m/Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
var payment_date_datePicker = flatpickr("#payment_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
dateFormat: "d/m/Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
var policy_start_date_datePicker = flatpickr("#policy_start_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
dateFormat: "d/m/Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
var policy_end_date_datePicker = flatpickr("#policy_end_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
dateFormat: "d/m/Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
@ -7046,7 +7046,7 @@ function appendMultiFileData(data) {
|
||||
newhtml = `
|
||||
<div class="form-group col-md-3">
|
||||
<label for="payment_date">Payment Date</label>
|
||||
<input type="text" class="form-control payment_date" id="payment_date" name="payment_date" placeholder="DD/MM/YYY">
|
||||
<input type="text" class="form-control payment_date" id="payment_date" name="payment_date" placeholder="DD/MM/YYYY">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
@ -7056,7 +7056,7 @@ function appendMultiFileData(data) {
|
||||
`;
|
||||
$('#not_installment').append(newhtml);
|
||||
$('.payment_date').flatpickr({
|
||||
dateFormat: 'd-m-Y',
|
||||
dateFormat: 'd/m/Y',
|
||||
});
|
||||
} else {
|
||||
toastr.error(response.message, 'Warning');
|
||||
@ -7155,7 +7155,7 @@ function appendMultiFileData(data) {
|
||||
$('#installment_form_row').append(html);
|
||||
|
||||
$('.payment_date').flatpickr({
|
||||
dateFormat: 'd-m-Y',
|
||||
dateFormat: 'd/m/Y',
|
||||
});
|
||||
}
|
||||
|
||||
@ -7312,7 +7312,7 @@ function appendMultiFileData(data) {
|
||||
$(document).ready(function(){
|
||||
setTimeout(function(){
|
||||
$('.payment_date').flatpickr({
|
||||
dateFormat: 'd-m-Y',
|
||||
dateFormat: 'd/m/Y',
|
||||
});
|
||||
}, 2000)
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user