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

208
Views
¿Puedo agregar eventos de calendario con Javascript?

Quiero que el usuario ingrese su Fecha, Hora, RESUMEN... etc.
y cree un archivo .ics , luego colóquelo en la aplicación de calendario predeterminada para crear un evento,
pero solo funciona en Safari,
cuando hago esto en Chrome, descargará el archivo .ics .

¿Es posible hacerlo funcionar tanto en iOS como en Android?

Aquí está mi código:

 function convertDate(date, time) { let dateStr = date.replaceAll('/', ''); let timeStr = time.replaceAll(':', ''); console.log(dateStr + 'T' + timeStr + '00'); return dateStr + 'T' + timeStr + '00'; } function addEvent() { let startDate = '2021/09/07'; let startTime = '14:30'; let endDate = '2021/09/07'; let endTime = '23:00' var icsMSG = "BEGIN:VCALENDAR\n" + "METHOD:PUBLISH\n" + "PRODID:-//VMFIVE//EN\n" + "VERSION:2.0\n" + "BEGIN:VEVENT\n" + "DTSTART:" + convertDate(startDate, startTime) + "\n" + "DTEND:" + convertDate(endDate, endTime) + "\n" + "SUMMARY:" + 'TEST EVENT' + "\n" + "DESCRIPTION:" + 'TEST DESCRIPTION' + "\n" + "END:VEVENT\n" + "END:VCALENDAR"; window.open("data:text/calendar;charset=utf8," + escape(icsMSG)); }
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!