final calendar.js

This commit is contained in:
Sajal Sharma
2017-10-07 01:36:38 -07:00
parent 65cf0135c1
commit 5a3d5b77ef
+10 -12
View File
@@ -1,14 +1,14 @@
console.log("hey");
//console.log("hey");
function getInformation(information)
{
var elements = information.split(" ");
console.log(elements);
//console.log(elements);
date = elements[1];
console.log(date);
//console.log(date);
datePortion = "20" + date.substring(6) + "-" + date.substring(0, 2) + "-" + date.substring(3, 5);
console.log(datePortion);
//console.log(datePortion);
militaryTime = true;
for (var i = 0; i < elements.length; i++)
@@ -18,7 +18,7 @@ function getInformation(information)
militaryTime = false;
}
}
console.log(militaryTime);
//console.log(militaryTime);
timePortion1 = "";
timePortion2 = " ";
@@ -26,8 +26,8 @@ function getInformation(information)
{
timePortion1 = elements[2] + ":00-07:00";
timePortion2 = elements[3] + ":00-07:00";
console.log(timePortion1);
console.log(timePortion2);
//console.log(timePortion1);
//console.log(timePortion2);
}
else
{
@@ -51,7 +51,7 @@ function getInformation(information)
timePortion2 = hour + elements[3].substring(2, 5);
}
}
console.log([elements[0], datePortion + "T" + timePortion1, datePortion + "T" + timePortion2]);
//console.log([elements[0], datePortion + "T" + timePortion1, datePortion + "T" + timePortion2]);
return [elements[0], datePortion + "T" + timePortion1, datePortion + "T" + timePortion2];
}
@@ -61,8 +61,8 @@ function makeEvent(information)
var event = {
'summary': fields[0],
'location': '800 Howard St., San Francisco, CA 94103',
'description': 'A chance to hear more about Google\'s developer products.',
'location': '',
'description': '',
'start': {
'dateTime': fields[1],
'timeZone': 'America/Los_Angeles'
@@ -96,5 +96,3 @@ function makeEvent(information)
appendPre('Event created: ' + event.htmlLink);
});
}
getInformation("Bob's 01/24/24 12:33AM 1:23AM");