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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 498k
  • Answers 498k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm not sure I fully understand your question but I… May 16, 2026 at 12:25 pm
  • Editorial Team
    Editorial Team added an answer I solved the problem by using a reverse proxy (in… May 16, 2026 at 12:25 pm
  • Editorial Team
    Editorial Team added an answer It has been solved here on tex.stackexchange.org. \ref has been… May 16, 2026 at 12:25 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm interested in speed, not good looking code, that is why I'm using array
I'm looking for code samples and tutorials for integrating iAd in iOS 4. What
I have been going through the docs and source code looking for something without
In looking at some code reflected from the WCF libraries, I'm seeing a pattern
All, I've got the following code, and looking into ways to improve its readibility
I have a jquery bug and I've been looking for hours now, I can't
I'm looking for a regular expression to validate hex colors in ASP.NET C# and
I'm looking for a concise way to compare two arrays for any match. I
By day I write C#. Everything I do goes through Microsoft code analysis and
Am I doing this right? I went to look at some old PHP code

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.