I want to create an alert with a YES_NO question when the value of 2 cells are the same. 1 cell will have the current time [=now()], and the other cell has a time something is due. Can i have a ui alert when the 2 times match. Here's the code i have written so far, it will currently work even if the times do not match.
function LiDCOcheck(){
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var ui = SpreadsheetApp.getUi();
  var buttons = ui.ButtonSet.YES_NO;
  var bed = ss.getRange("C2").getValue();
  var due = ss.getRange("D2").getValue();
  var time = ss.getRange("A2").getValue();
  if (due=time){    
    var lidco = ui.alert("It hsa been 24 hours since the LiDCO in Bed " + bed + " was calibrated.  Is it still required?", buttons);
    if (lidco == ui.Button.YES){
      ss.getRange("D2").setBackground('#6aa84f');}
    else{
      ss.getRange("D2").setValue('Not Required')}}
}
Thanks
 
     
    