简体   繁体   中英

Confirmation Email issues

I have two issues with the submit formsubmitreply script I am working on and I can't seem to get it to work no matter what I do.

The first issue is when you enter a time in the form, it loads into the spreadsheet in the correct format but then when it is entered into the confirmation email it becomes GMT +0. I can not for the life of me figure out why or how.

The oldest ticket (not assigned to someone) is dated: 9/19/2015 at 05:00 PM

The second issue in the same script is I can not get rid of the decimal points in the email.

It is having the same exact issue as above where it is corrected perfectly in the spreadsheet but when it is put into the email it reverts to what it says below: We are approximately 123.03481555567123 hours out.

Here is some snippets of script from the date issue

var sheet = SpreadsheetApp.getActiveSheet();  
var lastRow = sheet.getLastRow();
var ufdateFQ = sheet.getRange(lastRow, getColIndexByName("Oldest Ticket")).getValue();
var dateFQ = Utilities.formatDate(ufdateFQ, "GMT -5", "M/dd/yyyy' at 'hh:mm a");

And then I add it to the variable like this:

var emailBody = "ticket (not assigned to someone) is dated: <b><font color=#cc0000>"+ dateFQ;

and I have it in the mail app

htmlBody: emailBody,

Then here are some snippets of code from the hours out. Column A is the time stamp and column I is the date they input on the form.

  sheet.getRange(lastRow, getColIndexByName("Days Out")).setValue("=(A:A-I:I)*24"); 
  sheet.getRange(lastRow, getColIndexByName("Days Out")).setNumberFormat('@STRING@');
  sheet.getRange(lastRow, getColIndexByName("Days Out")).setNumberFormat("0");
  var hoF = sheet.getRange(lastRow, getColIndexByName("Days Out")).getValue();

I add it to the email same as I did above.

Thank you for your help! -Marc

I fixed the date issue by adding another cell and having it subtract the hours. then I Had my script pull from the fixed cell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM