fixed a bug on the sms units/charge display

This commit is contained in:
Kwesi Banson Jnr
2026-04-27 17:37:32 +00:00
parent 757f908404
commit d0f50a8549
3 changed files with 7 additions and 11 deletions

View File

@@ -15,7 +15,7 @@
function sendDailySmsUnits() {
document.getElementById('loadingOverlay').style.display = 'flex';
const endpoint = "{{ route('client.dailysmsunits') }}";
const endpoint = "client-dailysmsunits";
const startDate = startDateElement.value;
const endDate = endDateElement.value;
fetch(endpoint, {
@@ -50,7 +50,7 @@
}
}
var table = new Tabulator("#message-table", {
ajaxURL: base_url = "client-traffic-tabulator", // "https://smsportal.clickmlapps.com/client-traffic-tabulator/",
ajaxURL: base_url = "client-traffic-tabulator",
ajaxConfig: {
method: "GET",
headers: {
@@ -88,13 +88,12 @@
invalidPlaceholder:"(invalid date)"
},
headerFilter:function(cell, onRendered, success, cancel){
// Create native date input
var input = document.createElement("input");
input.type = "date";
input.addEventListener("change", function(){
console.log(input.value);
success(input.value); // pass value to Tabulator filter
success(input.value);
});
return input;
@@ -103,7 +102,6 @@
if(!headerValue){ return true; } // no filter
if(!rowValue){ return false; }
// Extract just the date portion from ISO timestamp
const rowDate = new Date(rowValue);
const formatted = rowDate.toISOString().split("T")[0]; // yyyy-MM-dd