feat(dm): changes to have a default time if nothing is passed in the excel
This commit is contained in:
@@ -7,6 +7,10 @@ export const excelDateStuff = (serial: number, time: any = 0) => {
|
||||
// get the local timezone
|
||||
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;
|
||||
//console.log(getJsDateFromExcel(addHours));
|
||||
if (typeof serial !== "number" || serial <= 0) {
|
||||
@@ -23,6 +27,8 @@ export const excelDateStuff = (serial: number, time: any = 0) => {
|
||||
date.setMinutes(minutes);
|
||||
}
|
||||
//console.log(date.toLocaleString("en-US"), getJsDateFromExcel(addHours));
|
||||
|
||||
//console.log(serial);
|
||||
//console.log(date.toISOString());
|
||||
return date.toISOString(); //.toLocaleString("en-US"); // or .toISOString() if preferred
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user