Me gustaría por favor si alguien pudiera ayudarme a como implementar google calendar api a los jsp he buscado por todos lados y no he conseguido nada,
la verdad es que no logro comprender la documentación de google


Escrito 30 abril 2014 - 05:00
Escrito 02 mayo 2014 - 05:04
function auth() { var config = { 'client_id': '[color=green]YOUR ID CLIENT[/color]', //<=== Se consigue en google console developer 'scope': 'https://www.googleapis.com/auth/calendar' }; gapi.auth.authorize(config, function() { // alguna función despues de autorizar. En mi caso, mostrar formulario y calendario. [color=green]document.getElementById("calendario").removeAttribute("hidden"); document.getElementById("addEvent").removeAttribute("hidden");[/color] }); }
function insertEvent() { var Fin = document.getElementById("fechaFin").value + 'T'+ document.getElementById("horaFin").value+":00-07:00"; var Inicio = document.getElementById("fechaInicio").value + 'T'+ document.getElementById("horaInicio").value+":00-07:00"; var resource = { "end": { "dateTime": ""+Fin+"", "timeZone": 'America/Hermosillo' }, "start": { "dateTime": ""+Inicio+"", "timeZone": 'America/Hermosillo' }, "description": ""+document.getElementById("descripcion").value+"", "summary": ""+document.getElementById("titulo").value+"", "location": ""+document.getElementById("lugar").value+"" }; gapi.client.load('calendar', 'v3', function() { var request = gapi.client.calendar.events.insert({ 'calendarId': '[color=green]YOU CALENDAR ID[/color]',//<=== Se consigue en las configuraciones del calendario. 'resource': resource }); request.execute(function(resp) { console.log(resp); if (resp.id){ //Si se logro insertar el evento alert("Event was successfully added to the calendar!"); document.getElementById("calendario").src = "https://www.google.com/calendar/embed?src=sapito.technology%40gmail.com&ctz=America/Hermosillo"; } else{ //Si no se logro insertar el evento alert("An error occurred. Please try again later.") } }); }); }