Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nishant0708 committed Jul 20, 2024
1 parent c2706b8 commit 859883e
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/components/PForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ const PForm = () => {
const expiryDate = new Date(expiry_date);
const diffDays = (expiryDate - mfdDate) / (1000 * 60 * 60 * 24);

let notifyDays;
if (diffDays > 3) {
notifyDays = 3;
} else {
notifyDays = 1;
}
let notifyDays =diffDays;
// if (diffDays > 3) {
// notifyDays = 3;
// } else {
// notifyDays = 1;
// }

if (!notificationTimeout) {
alert(`Set notification for ${notifyDays} days`);
Expand Down Expand Up @@ -85,12 +85,13 @@ const PForm = () => {
const expiryDate = new Date(expiry_date);
const diffDays = (expiryDate - mfdDate) / (1000 * 60 * 60 * 24);

let notifyDays;
if (diffDays > 3) {
notifyDays = 5;
} else {
notifyDays = 1;
}
let notifyDays=diffDays ;

// if (diffDays > 3) {
// notifyDays = 5;
// } else {
// notifyDays = 1;
// }

const productDataWithNotification = {
...formattedProductData,
Expand All @@ -103,7 +104,7 @@ const PForm = () => {
"Manufacturing date cannot be greater than or equal to expiry date."
);
}

console.log("diff",diffDays);
try {
const token = localStorage.getItem("token");

Expand Down

0 comments on commit 859883e

Please sign in to comment.