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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:59:04+00:00 2026-05-31T16:59:04+00:00

Thank you very much in advance for reading. I’m programming a web application in

  • 0

Thank you very much in advance for reading.

I’m programming a web application in Struts.

I’m using a JQuery datepicker 1.7 as a calendar on the sidebar on the user’s view. (It’s the best option I could find)

I would like to highlight in the calendar a group of days starting from initial date (startDate) until the end (endDate) of several reminders I have in an array. This way, the user will be able to see on the calendar of the application, all the available days he has left in order to take action for each of his reminders.

I already have my array of reminders which I can access from the view. I was able to implement it properly thanks to guidance from a great fellow around here.

This is my javascript function for the datepicker:

$(function(){

            $('#datepicker').datepicker({
                flat: true,
                numberOfMonths: [1,1],
                dateFormat: 'dd/mm/yy',
                beforeShowDay: highlightDays
            });

There is another function, namely, highlightDays which is the one that is causing me trouble:

It’s parameter is the array “reminders” such that reminders[i].start is the startDate, and reminders[i].end is the endDate of reminder i, with i = number of reminders in the array.

function highlightDays(reminders) {
            for (var i = 0; i < reminders.length; i++) { 

                /** Below:
                 *If startDate is smaller than endDate,
                 *then highlight the days inbetween.
                 */

                if (new Date(reminders[i].start).toString() <= 
                    new Date(reminders[i].end).toString() ){              
                   return [true, 'ui-state-highlight'];
                 }
            } //Otherwise do not highlight
            return [true, ''];
       } 

The problem is the calendar won’t even show up when I open the application and log in. And the Apache Log or output do not show any errors. I’d like to know, where do you think I might be wrong? I will keep investigating, but I’d really appreciate your input!

P.D: I can access the elements of the array of reminders (endDate, startDate) and print these dates on screen, so that means the reminders array is not empty.

Thank you once again for taking the time to read.

  • 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-31T16:59:05+00:00Added an answer on May 31, 2026 at 4:59 pm

    From http://jqueryui.com/demos/datepicker/#event-beforeShowDay

    The function takes a date as a parameter and must return an array with [0] equal to true/false indicating whether or not this date is selectable, [1] equal to a CSS class name(s) or ” for the default presentation, and [2] an optional popup tooltip for this date. It is called for each day in the datepicker before it is displayed.

    Your callback function is not accepting a single date as a parameter, it’s taking an array of date ranges.

    You might want to figure out how to call the highlightdays function inside the loop of remdinder values.

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

Sidebar

Related Questions

Thank you very much in advance. I'd like to know if anyone knows about
thank you very much in advance for the help. I have to make an
First of all, thank you very much in advance for any attempt at helping
I'm using a Jquery form on my website. The from is pretty much simple
My apologies as I'm very much a Java noob. Anyways, I think I've dumbed
Thanks to Col. Shrapnel I am using a VERY basic PHP script to send
First of all, I have some time reading this page and I find very
I'm reading Conor McBride and Ross Paterson's Functional Pearl / Idioms: applicative programming with
I am using Rails 3. I was coding a controller very verbose. So i
I would like some help with something I have to implement. Thank you very

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.