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

101
Views
Verifique la fecha y la hora con el calendario de Google usando javascript

Estoy tratando de permitir que el usuario elija cierta fecha y hora y verifique el calendario si tenemos algún evento que interfiera con las entradas del usuario.

 <!DOCTYPE html> <html> <head> <base target="_top"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato"> <style> </style> </head> <body> <div>From<input class="w3-input w3-border" type="datetime-local" id="from"></div> <div>To<input class="w3-input w3-border" type="datetime-local" id="to"></div> <button style="width:100%" class="w3-button w3-black w3-section" onclick="check()">check</button> <div style="display:none" id="no">Not Available</div> <div style="display:none" id="yes">Available</div> <script> SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault());// 2018-06-19T22:38:28+0000 </script> <script> function check() { var startTime = document.getElementById("from").innerHTML; var endTime = document.getElementById("to").innerHTML; var cal = CalendarApp.getCalendarById("aqsv50qhum57qbh7a581cft1o0@group.calendar.google.com"); var allEvents = cal.getEvents(new Date(startTime), new Date(endTime)); if (allEvents.length > 0) { document.getElementById("no").style.display = "block"; }else { document.getElementById("yes").style.display = "block"; } } </script> </body> </html>

Intenté el código anterior pero no devuelve nada, gracias por ayudar

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

innerHTML es solo para contenido DENTRO de los corchetes del elemento.

Para las entradas, necesitaría la propiedad de valor como esta:

 var inputValue = document.getElementById("myTextInputID").value;
about 4 years ago · Juan Pablo Isaza Report
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!