fix(abbott orders): working on times coming over as yesterday
This commit is contained in:
@@ -118,7 +118,7 @@ export const abbottOrders = async (data: any, user: any) => {
|
||||
// now we want to make sure we only correct orders that or after now
|
||||
correctedOrders = correctedOrders.filter((o: any) => {
|
||||
const parsedDate = parse(o.date, "M/d/yyyy, h:mm:ss a", new Date());
|
||||
return isAfter(parsedDate, new Date());
|
||||
return isAfter(o.date, new Date().toISOString());
|
||||
});
|
||||
|
||||
// last map to remove orders that have already been started
|
||||
@@ -132,7 +132,7 @@ export const abbottOrders = async (data: any, user: any) => {
|
||||
(o: any) => String(o.po).trim() === String(oo.po).trim()
|
||||
);
|
||||
if (!isMatch) {
|
||||
console.log(`ok to update: ${oo.po}`);
|
||||
//console.log(`ok to update: ${oo.po}`);
|
||||
|
||||
// oo = {
|
||||
// ...oo,
|
||||
@@ -140,7 +140,7 @@ export const abbottOrders = async (data: any, user: any) => {
|
||||
// };
|
||||
postedOrders.push(oo);
|
||||
} else {
|
||||
console.log(`Not valid order to update: ${oo.po}`);
|
||||
// console.log(`Not valid order to update: ${oo.po}`);
|
||||
//console.log(oo)
|
||||
}
|
||||
});
|
||||
@@ -171,13 +171,14 @@ export const abbottOrders = async (data: any, user: any) => {
|
||||
orders: [...predefinedObject.orders, ...orders],
|
||||
};
|
||||
|
||||
console.log(updatedPredefinedObject);
|
||||
//console.log(updatedPredefinedObject);
|
||||
// post the orders to the server
|
||||
const posting = await postOrders(updatedPredefinedObject, user);
|
||||
//console.log(posting);
|
||||
|
||||
return {
|
||||
success: posting?.success,
|
||||
message: posting?.message,
|
||||
data: posting?.data,
|
||||
data: posting,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -22,6 +22,7 @@ export const excelDateStuff = (serial: number, time: any = 0) => {
|
||||
date.setHours(hours);
|
||||
date.setMinutes(minutes);
|
||||
}
|
||||
|
||||
return date.toLocaleString("en-US"); // or .toISOString() if preferred
|
||||
//console.log(date.toLocaleString("en-US"), getJsDateFromExcel(addHours));
|
||||
//console.log(date.toISOString());
|
||||
return date.toISOString(); //.toLocaleString("en-US"); // or .toISOString() if preferred
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user