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

173
Views
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
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!