Trying to do something which seems like it should be simple:
I have a small gui application in Google scripts. I would like to make a datePicker object appear, with the value (starting date) of a cell in the spreadsheet which the app works. I have looked through many of similar questions on stackOverFlow, but still can not find an answer that works.
For example, cell (2,5) in my sheet has a date in it, formated by Google itself. I would like a datePicker to display that date. Here is where I am at.
function testRun()
{
var ss = SpreadsheetApp.getActive();
var ui = UiApp.createApplication();
var controls = ui.createVerticalPanel().setHeight(350).setWidth(350);
var sheet = ss.getActiveSheet();
//Here I grab a cell's data. It logs as a date: Sat May 02 00:00:00 GMT-05:00 2015
var lastDay = sheet.getRange(2, 5).getValue();
Logger.log(lastDay);
//Here I would like to display a datePicker with the date
var datePicker = ui.createDatePicker();
datePicker.setValue(new Date(lastDay));
//datePicker.setvalue(lastDay); also does not work.
controls.add(datePicker);
To summarize: I can't get this datePicker to display a different day, based on a google sheet cell.
Thanks for the help.
