Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
tratando de cambiar todos los nuevos eventos del calendario a ocupado (opaco) y vista de calendario predeterminada

He anotado los usos del calendario de Google. Pude descubrir fácilmente cómo actualizar los eventos del calendario a la visibilidad predeterminada del calendario; sin embargo, tengo dificultades para asegurarme de que todos mis eventos estén configurados como ocupados (opacos) en mi calendario. En ocasiones, las personas configuran un evento como gratuito y me causa problemas con las reservas dobles. Estoy usando google calendar api, mi función está a continuación. soy un novato función

 var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Sheet1"); var ssId = ss.getId(); var sheetId = ss.getActiveSheet().getSheetId(); var start_time = new Date(); var end_time =new Date(new Date(start_time.getTime() + 120 * 1000 * 60 * 60 * 24)) ; var id_cal = sheet.getRange("C2").getValue(); var cal = CalendarApp.getCalendarById(id_cal); var events = cal.getEvents(new Date(start_time), new Date(end_time)); for (var i = 0;i<events.length;i++){ var vis = events[i].getVisibility(); if (vis != CalendarApp.Visibility.DEFAULT) { var setvis = events[i].setVisibility(CalendarApp.Visibility.DEFAULT); var splitid = events[i].getId().split("@")[0]; var freebusy = {transparency: "opaque", }; var setbusy = Calendar.Events.patch(freebusy, id_cal,splitid); var title = events[i].getTitle(); var data = [title]; var lastupdate = new Date(); sheet.insertRows(5, 1); sheet.getRange(5, 1, 1, 1).setValues([data]); } } Logger.log("Events have been added to the Spreadsheet"); Logger.log("Filter has been added."); }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!