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

588
Views
Cómo deshabilitar el clic en días pasados fullcalendar

Intento deshabilitar los últimos días en los que se puede hacer clic. Estoy usando dateClick pero no puedo pasar múltiples argumentos y tengo un error: *Error de tipo no detectado: date.format no es una función Mi función:

EDITAR: función Dateclick con ajax. Ahora no sé cómo deshabilitar el clic, cuando pasaron los días.

 dateClick: function (info, jsEvent, view, date) { let currDate = info.dateStr; // if (moment().format('YYYY-MM-DD') === currDate || date.isAfter(moment())) { // return false; // } else { // // alert('Date: ' + currDate); // alert('ID: ' + $('#reservation-form #select-service').val()); // } let selectServiceVal = $('select#select-service').val(); if (!selectServiceVal) { alert('Najpierw wybierz usługę'); } else { dateValue.val(currDate); $.ajax({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, url: getFreeHorus + selectServiceVal + '/' + currDate, dataType: 'json', method: "POST", data: { "id": selectServiceVal, "date": currDate }, beforeSend: function () { $(".calendary-loader").css('display', 'block'); }, success: function (data) { $(".calendary-loader").css('display', 'none'); if (data.message) { alert('Wybierz poprawną datę') } displayHours(data.availableHours); }, error: function () { $(".calendary-loader").css('display', 'none'); alert('Błąd serwera, spróbuj później') } }); } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puedes usar select . Así es como hice el mío:

select: this.handleDateClick.bind(this),

//la función handleDateClick

 handleDateClick(arg: any) { let todaysDate = new Date(); let formattedDate = moment(todaysDate).format("YYYY-MM-DDTHH:mm:ss"); //formatted version of todays date so a comparison can be made let s1 = arg.startStr; let s2 = arg.endStr; let currentdate = moment().isUTC(); let newDateObj = moment(s1).add(15, "m").format("YYYY-MM-DDTHH:mm:ss"); if (s1 < formattedDate) { //This checks if time is in the past. If so, alert("This date is in the past")
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!