Skip to content

Commit

Permalink
Merge pull request #456 from nishant0708/notification_colum
Browse files Browse the repository at this point in the history
Continuation of Issue #451
  • Loading branch information
usha-madithati authored Jul 21, 2024
2 parents fd500e8 + 859883e commit 6f4aa46
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 6f4aa46

Please sign in to comment.