Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

358
Vistas
get click date in addEvent modal

I'm working on a fullcalendar project. When I click on a day of my calendar it appeared a modal where you put the name of your event, the start date and end date. The input for start and end date is a datetime-local and I was looking for a way that when you click on a day and the modal show up in my start input is already visualize the day.

This is my modal and, for example, when I click on 4th of April it appeared directly like this, without me having to put it manually: like this ->example.

I found online this solution to get the clicked date:

dayClick: function(date, jsEvent, view, resourceObj) {
                    alert(date.format('DD/MM/YYYY 08:00'));   //format i decide
                    
                },

But i dont know how to applied to my code to have it as input and not alert


I found also this way, I like it better because I can add the hour I want:

var startDateSelected = moment(event.startStr).format("DD-MM-YYYY 08:00:00");
var endDateSelected = moment(event.endStr).format("DD-MM-YYYY 17:30:00");

but still havent found a way to applied to my input datelocal-time

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

At the end I found this solution:

select: function select(event, date) {              
    $('#addNewEvent').modal('show');
    $('#calendar').fullCalendar('refetchEvents',event._id);
    var now = new Date(event);
    document.getElementById('starts').value = now.toISOString().slice(0,16);
    document.getElementById('ends').value = now.toISOString().slice(0,16);
}

This is the function that open my modal and fecth the events from my database by ID And the ID mention in getElementById are from my two datetime-local input

I hope someone can find it useful. It refered to Fullcalendar v3 because that the version the template I'm using have

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda