trying to use the google calendar api to add events from quickbase

  • 0
  • 1
  • Question
  • Updated 12 months ago
  • (Edited)
im trying to use the google calendar api to add events from quickbase it seems to take very specific dates and im thinking there might be a better way to do this. Here is my code.


(function(){
  var dbid = "application dbid";
  var dbidTable = "table dbid";
  var apptoken = "app token";
  $.ajaxSetup({data: {apptoken: apptoken}});
  $("a.QBU_Button").on("click", function(event) {
    console.log("onclick in module.js");
    var data = this.dataset.start;
    var title = this.dataset.title;
    var start = new Date(this.dataset.start).toISOString()
    var end = new Date(this.dataset.end).toISOString()

start = start.split("")
for(var i=0; i<start.length; i++){
start[i] = start[i].replace("-","")
start[i] = start[i].replace(":","")
start[i] = start[i].replace(".","")
}
start = start.join("")

end = end.split("")
for(var i=0; i<end.length; i++){
end[i] = end[i].replace("-","")
end[i] = end[i].replace(":","")
end[i] = end[i].replace(".","")
}
end = end.join("")

var day = start+"/"+end


  console.log(day);

   
  window.open(`https://calendar.google.com/calendar/event?action=TEMPLATE&text=${title}&dates=${day}&lo...)
  });

})();
Photo of Michael Curtis

Michael Curtis

  • 596 Points 500 badge 2x thumb

Posted 12 months ago

  • 0
  • 1

Be the first to post a reply!