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 8046347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:45:38+00:00 2026-06-05T05:45:38+00:00

I am soooo close here. I’m hoping a guru can help me with this

  • 0

I am soooo close here. I’m hoping a guru can help me with this last piece. I’m populating a jQuery DatePicker calendar with XML from an RSS feed. Upon clicking a highlighted date where there’s an event, I’m creating a URL with a query string so I can display all the event for the clicked day. Everything is working… until I change the month by clicking previous or next month. My script will return the correct day, but is only returning the current month. For example, I navigate to May and click the 5th, my URL will be events.htm?month=june&day=5. Any ideas on why it will not return my selected month? Here’s my code:

var data = $.ajax({
  url: "news.xml",
  type: "GET",
  dataType: "xml",
  async:false,
  success: function(xml){
     return xml;
  }
} ).responseText;

$(document).ready(function() {

    var events = getSelectedDates();

    $("div.datepicker").datepicker({
        beforeShowDay: function(date) {
            var result = [true, '', null];
            var matching = $.grep(events, function(event) {
                    return event.published.getDate() === date.getDate() && event.published.getMonth() === date.getMonth() && event.published.getFullYear() === date.getFullYear();
            });

            if (matching.length) {
                result = [true, 'highlight', null];
            }
            return result;
        },
        onSelect: function(dateText) {
            var date, selectedDate = new Date(dateText),
                i = 0,
                event = null;

            while (i < events.length && !event) {
                date = events[i].published;

                if (selectedDate.getFullYear() === date.getFullYear() && 
                    selectedDate.getMonth() === date.getMonth() && 
                    selectedDate.getDate() === date.getDate()) {

                    event = events[i];
                }
                i++;
            }
            if (event) {
                var eMonNum = event.published.getMonth();
                var d = new Date();
                var eMonNum = new Array();
                eMonNum[0] = "january";
                eMonNum[1] = "february";
                eMonNum[2] = "march";
                eMonNum[3] = "april";
                eMonNum[4] = "may";
                eMonNum[5] = "june";
                eMonNum[6] = "july";
                eMonNum[7] = "august";
                eMonNum[8] = "september";
                eMonNum[9] = "october";
                eMonNum[10] = "november";
                eMonNum[11] = "december";
                var eMon = eMonNum[d.getMonth()];
                var eDay = event.published.getDate();
                window.location = "events.htm?month="+eMon+"&day="+eDay;
            }
        }
    });
});

function getSelectedDates() {
    return $(data).find('entry').map(function() {
        return {
            title: $('title', this).text(),
            published: new Date($('published', this).text())
        };
    }).get();
}
  • 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-06-05T05:45:39+00:00Added an answer on June 5, 2026 at 5:45 am

    Found the problem, when you copied this list from a resource, you forgot to replace the variables.

    CHANGE (at the end of month list)

    var eMon = eMonNum[d.getMonth()];
    

    TO:

    var eMon = eMonNum[event.published.getMonth()];
    

    All I did was get rid of the bad variable and reassigned your month variable to the one you used for the day. You can also remove the declaration of the d variable, as you will not need it.

    Best of luck!

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

Sidebar

Related Questions

Soooo we have this system here that's working as follows: We have a Java
I really hope someone can help on this because I'm learning cocoa and have
suppose I have this string: some striinnngggg <a href=something/some_number>linkk</a> soooo <a href=someotherthing/not_number>asdfsadf</a> I want
I've had soooo much trouble getting this code to work properly!!!! It runs fine
soooo i have this function that prints one of 5 random texts ON an
I've added a lightbox jQuery script and all is working soooo BEAUTIFULLY, until I
Soooo... I was working on this page using jsFiddle and it doesn't work the
Soooo, I am starting this new job soon where most of the code is
This is soooo weird. I cannot seem to get any output messages from Sys.Debug
soooo i can't seem to get some div alignments to work. basically, i have

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.