Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
taugk committed Dec 17, 2023
1 parent ac59c72 commit 1ecb2fa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions routes/postsRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,10 @@ router.post(
imageUrl = req.file.cloudStoragePublicUrl;
}

let formatDateTime = "";
let numericDateTime = 0;
let pickupTimeMilliseconds = 0;
try {
const datetime = moment.unix(pickupTime);
formatDateTime = datetime.format("YYYY-MM-DD HH:mm:ss");
numericDateTime = datetime.unix();
pickupTimeMilliseconds = datetime.valueOf();
} catch (error) {
console.error("Error converting pickupTime:", error);
}
Expand All @@ -470,7 +468,7 @@ router.post(
title,
description,
price,
pickupTime: formatDateTime,
pickupTime: pickupTimeMilliseconds,
imgUrl: imageUrl,
freshness,
lat,
Expand Down

0 comments on commit 1ecb2fa

Please sign in to comment.