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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:24:26+00:00 2026-05-28T14:24:26+00:00

I have a pair of date fields, from and to, and am using jQuery

  • 0

I have a pair of date fields, from and to, and am using jQuery 1.7.1, jQuery UI 1.8.16 and latest webshims. For from I need to set the minDate dynamically as the page loads AND it needs to be different from the minDate of the to field. The to field min is the from plus one day.

I tried to manage this by using setting a data-datepicker attribute on the two fields and populating from’s minDate using JavaScript inside the $ready function. Using the browser console I can see that the data-datepicker has the proper values after page load.

Unfortunately webshims doesn’t seem to be using these values.

  $("#mbdrFrom, #mbdrTo").datepicker();
  var fromDm = $('#mbdrFrom').data('max-date');
  $('#mbdrFrom').attr('data-datepicker', "{'minDate': "+getEarliestDate()+", 'maxDate':"+fromDm+"}");
  $('#mbdrFrom').getShadowElement().attr('data-datepicker', "{'minDate': "+getEarliestDate()+", 'maxDate':"+fromDm+"}");

I also tried just hardcoding the values in the HTML to see if I could get a better result:

<input type="date" id="mbdrFrom" value="01/05/2012" data-datepicker="{'maxDate': '01/05/2012', 'minDate':'11/18/2011'}">

No difference in functionality.

Help appreciated!

  • 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-28T14:24:27+00:00Added an answer on May 28, 2026 at 2:24 pm

    The answer, for posterity, is that in this scenario the values should be set on the input element’s min and max attributes.

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

Sidebar

Related Questions

I have a pair of static fields with a complicated one-time initialization. I want
I have a public/private key pair set up so I can ssh to a
I have a table with 3 fields: id datestart dateend I need to query
We have a pair of Oracle servers which are set up as nodes in
I have a pair of shell programs that talk over a named pipe. The
If I have a pair of dates, and I want to generate a list
I have a situation where I want to map a pair of objects to
If I have a vector of pairs: std::vector<std::pair<int, int> > vec; Is there and
Let's say I have a sequential container, and a range (pair of iterators) within
I have the following code: foreach (Tuple<Point, Point> pair in pointsCollection) { var points

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.