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

165
Vistas
Preserve JQuery fullCalendar when navigating back to the page using vue.js or Jquery

I have a calendar function that gets and sets a chosen start date, which works ok.

However when navigating away from the page and back to the previous page. How do I preserve the calendar on the day/month chosen when its beyond the present month. e.g. We are now in January, but if I navigate away to feb or march and navigate back, it defaults back to january.

Here is my code

 var fullDate = new Date();
 var newdate = new Date(fullDate);

 newdate.setDate(newdate.getDate() + 90);

 $('div[data-type="datepicker-coverStartDate"]').fullCalendar({
       dayClick: function(date, allDay, jsEvent, view) {
         if (moment(date).isSameOrAfter(moment().startOf('day'))) {
           $('.fc-state-highlight').removeClass("fc-state-highlight");
           $(this).addClass("fc-state-highlight");
           $('div[data-type="datepicker-coverStartDate"]').datepicker("setDate", $('#inpCoverStartDateActual').attr("value"));
           onDatePickerChanged('coverStartDate', date.toLocaleDateString("en-gb"));
         }
         if (date >= newdate) {
           $(this).removeClass("fc-state-highlight");
           $(this).addClass("fc-state-disabled");

         }
       }

and html input and calendar field

<input type="hidden" id="inpCoverStartDateActual" 
  v-bind:value="coverStartDate"
  name="@(NameOf<TellUsAboutYourHomeViewModel>.Full(basePropertyName, m => m.CoverStartDate))" 
  value="@(Model.CoverStartDate == DateTime.MinValue ? "" : Model.CoverStartDate.ToString(" dd/MM/yyyy"))" />
<div id="inpCoverStartDate" 
  value="@(Model.CoverStartDate == DateTime.MinValue ? "" : Model.CoverStartDate.ToString(" dd/MM/yyyy"))"
  data-type="datepicker-coverStartDate" 
  data-vue-data="coverStartDate" 
  type="text">
</div>
about 4 years ago · Juan Pablo Isaza
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