Skip to content

Commit

Permalink
fix time last
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricky Raup authored and Ricky Raup committed May 17, 2024
1 parent fa1e498 commit a64096a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/src/services/mail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const parseArray = (array: any) => {
};

const formatOrderToEmail = (order: IOrder) => {
const pickupDate = new Date(order.pickup);
let pickupDate = new Date(order.pickup);
if (order.advanced) {
return (
`<div style="color:black;">Organization: ${order.organization}</div>` +
Expand All @@ -120,6 +120,11 @@ const formatOrderToEmail = (order: IOrder) => {
})}</div>`
);
}
const adjustDateByHours = (date: Date, hoursToSubtract: number): Date => {
date.setHours(date.getHours() - hoursToSubtract);
return date;
};
pickupDate = adjustDateByHours(pickupDate, 4);
return (
`<div style="color:black;">Organization: ${order.organization}</div>` +
`<div style="color:black;">Produce: ${order.produce}</div>` +
Expand Down

0 comments on commit a64096a

Please sign in to comment.