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