INNER CODE UNIT · JavaScript

remainingDays

adrianhajdin/project_crowdfunding · client/src/utils/index.js:3

  const remainingDays = difference / (1000 * 3600 * 24);

  return remainingDays.toFixed(0);
};

export const calculateBarPercentage = (goal, raisedAmount) => {
  const percentage = Math.round((raisedAmount * 100) / goal);

  return percentage;
};

export const checkIfImage = (url, callback) => {
  const img = new Image();
  img.src = url;

  if (img.complete) callback(true);

  img.onload = () => callback(true);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…