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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:50:49+00:00 2026-05-30T21:50:49+00:00

Can someone please tell me how I can make the datepicker pick a date

  • 0

Can someone please tell me how I can make the datepicker pick a date that is after a certain date I choose.

For example I want the date picker to pick dates after 03/08/2012.

Here is my simple datepicker:

<script type="text/javascript">
$(function(){
   $("#date").datepicker({ dateFormat: 'm/d/yy', minDate: 0});
});
</script>

What if the date was stored in a php variable. for eg. $var=’03/08/2012′. Is splitting it one by one only way to do it?

I am trying to get the date from a dynamic php variable. For eg:

<script type="text/javascript">

$(function() {
    $( "#date" ).datepicker({ minDate: new Date(<?php echo $split_date[2];?>, <?php echo ($split_date[0] - 1);?>, <?php echo $split_date[1]; ?>)});
});

</script>

<?php
 $date='03/08/2011';

$split_date=explode("/",$date);
echo $split_date[0];
echo $split_date[1];
echo $split_date[2]; 
?>

but nothing i tried so far works!

  • 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-30T21:50:51+00:00Added an answer on May 30, 2026 at 9:50 pm

    According to jQuery’s doc on the Datepicker, you should do

    <script>
    $(function() {
        $( "#datepicker" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
    });
    </script>
    

    Restrict the range of selectable dates with the minDate and maxDate options. Set the beginning and end dates as actual dates (new Date(2009, 1 – 1, 26)), as a numeric offset from today (-20), or as a string of periods and units (‘+1M +10D’). For the last, use ‘D’ for days, ‘W’ for weeks, ‘M’ for months, or ‘Y’ for years.

    If you want it to start from 03/08/2012, you should write

    <script>
    $(function() {
        $( "#datepicker" ).datepicker({ minDate: new Date(2012, 3 - 1, 8)});
    });
    </script>
    

    You can also refer to this answer:
    changing minDate option in JQuery DatePicker not working

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

Sidebar

Related Questions

can someone please tell why , Great Microsoft that created C# language and now
Can someone tell me please why the following example work in Firefox but not
Could someone please tell me how I can make the icon for my app
Can someone please tell me why this doesn't work? I'm trying to show and
Can someone please tell me how I can implement the following line of pseudo-code.
Can someone please tell me ehy in IE 6 div is not in center.
I can't seem to get this text to align vertically. Can someone please tell
I have developed a Jersey Resource class. Can someone please tell me how can
I'm new to the world of Mac programming. Can someone please tell me what
Could someone please tell me which objects types can be tested using Regular Expressions

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.