Currently, I am utilizing Google Scripts which means it is purely JavaScript.
The array that I am working with looks like this:
[Tue Dec 23 00:00:00 GMT+00:00 2014,
816.43,
Tue Jan 28 00:00:00 GMT+00:00 2014,
729.43]
My goal is to reformat the date in order to eliminate the time and GMT components so it would appear as follows:
[Tue Dec 23 2014,
816.43,
Tue Jan 28 2014,
729.43]
To achieve this, I have implemented a for loop and I am trying to utilize the .replace function to remove "00:00:00" and "GMT+00:00" from my array named 'data'
var arrayLength = data.length;
for (var i = 0; i < arrayLength; i++) {
var newData = data[i].replace("00:00:00", "");
}
However, an error message is being displayed:
TypeError: Cannot find function replace in object Tue Dec 23 2014 00:00:00 GMT-0000 (GMT)