I have a search script that I am using to search a spreadsheet. One of the returned values is a date. On the spreadsheet it looks like mm/dd/yyyy but in the text box it shows a full date like Fri May 10 2013 03:00:00 GMT The code line looks like:
txt1.setText(data[nn][14]);
How do I make it look like mm/dd/yyyy 01/26/2013? I tried
var date = (Date(data[nn][14]), "EST", "MM/dd/yyyy") but it literally shows MM/dd/yyyy
Also I have txt1.setText(data[nn][0]).setStyleAttribute("background", "cyan"); That colors important boxes. Just as a visual aid. On the spread sheet that date has conditional formatting that turns it red of the date is before the current date. (Expired) Is there a way to make the script look for that formatting or preform the same conditional format?
This is what I could come up with,
if(data[nn][14] < Date(), .setStyleAttribute("background", "red"));
But it doesn't work