I am trying to combine 2 cells in apps script to generate a single date for adding an event to my calendar.
function ConcatenateDateCells () {
var spreadsheet = SpreadsheetApp.getActive();
var sheet1 = spreadsheet.getSheetByName("TABLEAU DE BORD")
var clientName = sheet1.getRange("D4").getDisplayValue(); // Client's name
var title = sheet1.getRange("E5").getDisplayValue(); // Event title
var calendar = CalendarApp.getDefaultCalendar(); // Default calendar
var rawDate = sheet1.getRange('H13').getValue(); // Date: 22/12/2016
var time = sheet1.getRange('I13').getValue(); // Time: 18:00
var formattedDate = rawDate + " " + time;
calendar.createEvent(clientName + " : " + title, formattedDate, formattedDate);
}
I want the formatted date to be: Thu Dec 22 2016 18:00:00 GMT+0100 (CET)
Would this formatting be achievable? Apologies for any language errors (French is my native language).