Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

357
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda