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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:07:05+00:00 2026-06-15T22:07:05+00:00

I want to customize jquery ui date picker by setting server date as current

  • 0

I want to customize jquery ui date picker by setting server date as current date.

After refering a question

i wrote down

var queryDate = '2012-11-15',
    dateParts = queryDate.match(/(\d+)/g)
    realDate = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);  
                                // months are 0-based!


$('#datepicker').datepicker('setDate', realDate);
$('#datepicker').datepicker({ dateFormat: 'yy-mm-dd' });

it works, but when i change second step to

$('#datepicker').datepicker({ dateFormat: 'yy-mm-dd',minDate: 0,maxDate: '+6M' });

it shows dates according to the system date not the server date which i had assigned,

How to solve this??

  • 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-15T22:07:06+00:00Added an answer on June 15, 2026 at 10:07 pm

    You can just set the value of the input field to be a value from the server side:

    <script>
    var queryDate = '2012-02-25';
    var dateParts = queryDate.match(/(\d+)/g);
    
    var realDate = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
    
    var min_date = new Date(2012, 2 - 1, 25 - 20); //feb 5 is the min date
    var max_date = new Date(2012, 2 - 1, 25 + 1); //feb 26 is the max date
    
    $( "#date" ).datepicker({dateFormat: 'yy-mm-dd', minDate: min_date, maxDate: max_date});
    $( "#date" ).datepicker("setDate", realDate);
    </script> 
    

    In this case we are setting the date to 2012-02-25. In order for this to work you must set the format of the datepicker to be the same as the format that you’ve used for the value which is 'Y-m-d'

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

Sidebar

Related Questions

i have a jquery slider function and i want to customize it. my requirement
I am using the jQuery mask plugin from http://digitalbush.com/projects/masked-input-plugin/ I want to customize my
I want to implement and customize Tiny MCE jquery version. Don't know how to
When I initialize a jquery date picker like $( #datepicker ).datepicker({ changeMonth: true, changeYear:
I've just setup a Jquery image rotator on my website and want to customize
I'm using jquery lightbox in a project, and I want to customize it a
I want to customize this jQuery plugin. There is a type JS variable. On
I'm looking to customize the default date header in blogger with jQuery. The original
I want to fully customize jQuery UI tabs without breaking the styles of jQuery
My app works with the Devise gem for authentication, but I want customize it

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.