JSFiddle - React, Tailwind, and code Playground

JavaScript

// To set two dates to two variables
let date1 = new Date("04/01/2020");
let date2 = new Date("08/01/2020");
  
// To calculate the time difference of two dates
let Difference_In_Time = date2.getTime() - date1.getTime();
  
// To calculate the no. of days between two dates
let Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);

//Set your two price points
let price1 = 900;
let price2 = 1500;

//Calculate price delta
let Difference_In_Price = price2 - price1;

//Divide the price delta and the days delta. Setting the value to a two decimal place fixed value.
let Price_Over_Period = (Difference_In_Price / Difference_In_Days).toFixed(2);

document.write(Price_Over_Period);