Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 979067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:09:39+00:00 2026-05-16T04:09:39+00:00

By looking at the code I’ve provided below, does anyone know why the repeat

  • 0

By looking at the code I’ve provided below, does anyone know why the repeat is not consistent throughout each month? What I mean by this is for the first month that displays up until the end, the repeat works fine, then towards the end of the month onwards, the repeat is not displaying correctly. The output of the below code can be seen here on jsbin just click preview.

 (function() {
    function MyEvents(start,end, callback) {
      var events = [];
      // Setup the meeting on the this weeks "monday"
      var meeting = new Date(start.getFullYear(), 
                             start.getMonth(), 
                             start.getDate(),
                             4, 30, 00);

      var endmeeting = new Date(2010, 07, 06, 8, 00, 00);

      meeting.setDate((meeting.getDate() - meeting.getDay()) + 1);

      var newEnd = new Date(end);
      var maxEnd = new Date((newEnd.getFullYear() + 1), newEnd.getMonth(), newEnd.getDate());

      //==========Calculate Repeat===========//
      var oneDay = 1000 * 60 * 60 * 24;
      var date1 = meeting.getTime();
      var date2 = endmeeting.getTime();
      var difference = Math.abs(date1 - date2);
      var days = Math.abs(difference / oneDay);

      while (meeting <= maxEnd) {
            var endDate = new Date();
            endDate.setDate(meeting.getDate() + days);
            events.push({
                id: 2,
                title: "Monday Meeting",
                start: new Date(meeting.valueOf()),
                end: endDate,
                allDay: false
            });

            // increase by one week
            meeting.setDate(meeting.getDate() + 7);
        }

      callback(events);
    }
    $('#calendar').fullCalendar({
          header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,basicWeek,basicDay'
          },
          events: MyEvents
        });
    });

Edit — I see what is wrong why this. If I put an “alert(endDate);” before “meeting.setDate(meeting.getDate() + 7);”, I do see that it is giving me the correct “end” Date. The problem here is that once it gets to September and incoming months, the month will always stay on “August” but the dates are the correct dates for. So for example once it gets to “September 10”, this will again be “August 10”, “September 17” will be “August 17”. Dates changes but not month. Any idea people?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:09:40+00:00Added an answer on May 16, 2026 at 4:09 am

    Update — here you can see the update and what I did to make the repeat consistent throughout each month. Just click the preview. I hope this will help whoever’s stuck on this issue as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking at code, and I'm not certain of its functionality. I looked at
I'm interested in speed, not good looking code, that is why I'm using array
Not really looking for code examples here, just concepts. I have three sections on
I'm looking at code that does uses an _ for typename in a namedtuple
How to make this subqueries to good-looking code? And I looking guides about SQL
I really love SyntaxHighter - it turns out the poshest looking code around. Unfortunately
I am looking to code me a banner management system that has users make
Sometime when looking through code, I see many methods specify an annotation: @SuppressWarnings(unchecked) What
I am looking at code which has the correct using statements declared but yet
I was looking at code that implemented the ICloneable interface for one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.