In my google sheet with Sheet Name Time_Select
, I am having a trouble finding the Date.
here is my link for the google sheet: https://docs.google.com/spreadsheets/d/1lEfzjG1zzJVPMN8r-OpeZm6q9_IqSwk9DNCEY-q7ozY/edit?usp=sharing
here is my code in Google Apps Script:
function testRow(){
var lookup = "Aug 28, 2019";
var ss = SpreadsheetApp.openByUrl(url);
var ts = ss.getSheetByName("Time_Select");
var checkData = ts.getRange(1, 1, 1, ts.getLastColumn()).getValues()[0];
var index = checkData.indexOf(lookup);
Logger.log(index)
}
I get the result of -1
in the log, meaning it was not found in the google sheet.
Then i logged the checkData
variable and noticed that the Year was in the last part of the date and not like the other which had the (HKT) or something in it.
here is the log result of the checkData
:
[19-08-26 03:27:09:804 PDT] [Wed Aug 28 00:00:00 GMT+08:00 2019, Thu Aug 29 00:00:00 GMT+08:00 2019, Fri Aug 30 00:00:00 GMT+08:00 2019, Sat Aug 31 00:00:00 GMT+08:00 2019, Sun Sep 01 00:00:00 GMT+08:00 2019]
Do you have any idea on how to fix this or how can I search the date in the google sheet? Thank you in advance for the help.