feat(dm): changes to have a default time if nothing is passed in the excel

This commit is contained in:
2025-08-06 15:25:45 -05:00
parent c52e2a8671
commit 9e5577e6bb

View File

@@ -7,6 +7,10 @@ export const excelDateStuff = (serial: number, time: any = 0) => {
// get the local timezone // get the local timezone
const localoffset = new Date().getTimezoneOffset() / 60; // then divide by 60 to get the true number; const localoffset = new Date().getTimezoneOffset() / 60; // then divide by 60 to get the true number;
if (serial % 1 === 0) {
time = 800;
}
const addHours = serial + localoffset / 24; const addHours = serial + localoffset / 24;
//console.log(getJsDateFromExcel(addHours)); //console.log(getJsDateFromExcel(addHours));
if (typeof serial !== "number" || serial <= 0) { if (typeof serial !== "number" || serial <= 0) {
@@ -23,6 +27,8 @@ export const excelDateStuff = (serial: number, time: any = 0) => {
date.setMinutes(minutes); date.setMinutes(minutes);
} }
//console.log(date.toLocaleString("en-US"), getJsDateFromExcel(addHours)); //console.log(date.toLocaleString("en-US"), getJsDateFromExcel(addHours));
//console.log(serial);
//console.log(date.toISOString()); //console.log(date.toISOString());
return date.toISOString(); //.toLocaleString("en-US"); // or .toISOString() if preferred return date.toISOString(); //.toLocaleString("en-US"); // or .toISOString() if preferred
}; };