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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:23:49+00:00 2026-05-15T23:23:49+00:00

I am stuck with a problem of formatting jQuery UI Calendar. The format for

  • 0

I am stuck with a problem of formatting jQuery UI Calendar. The format for the calendar is based on the user preference. If the user selects the Date format from the first select box, then the UI calendar format should be based on that… Please share ideas on how to achieve this.. thanks in advance..

jQuery Code

jQuery(function() {

        var format = 'yy-mm-dd';
        jQuery('#dateFormat').change(function(){
        format = jQuery('#dateFormat').val();
        alert(format);  
        });

        jQuery('#fromDate').datepicker({
        showTime: false,
        dateFormat: format,
        showOn: 'button',buttonText: 'Date', buttonImage: 'images/calendar.gif', buttonImageOnly: true
        });

        jQuery('#toDate').datepicker({
        showTime: false,
        dateFormat: 'dd-mm-yy',
        showOn: 'button',buttonText: 'Date', buttonImage: 'images/calendar.gif', buttonImageOnly: true
        });

});

Html Code is as follows

<label>Date Format</label>
<select name="dateFormat" id="dateFormat">
<option val="1">dd-mm-yy</option>
<option val="2">yy-mm-dd</option>   
</select>
<label>Period start:</label>
<input type="text" value="" size="30" name="fromDate" id="fromDate" />
<label>Period start:</label>
<input type="text" value="" size="30" name="toDate" id="toDate" />
  • 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-15T23:23:49+00:00Added an answer on May 15, 2026 at 11:23 pm

    try this:

    var fromDate = jQuery('#fromDate');
    var toDate = jQuery('#toDate');
    var dateFormat = jQuery('#dateFormat');
    
    dateFormat.change(function(){
      var format = jQuery(this).val();
      fromDate.datepicker('option','dateFormat',format);
      toDate.datepicker('option','dateFormat',format);
    });
    
    fromDate.datepicker({
      showTime: false,
      dateFormat: format,
      showOn: 'button',buttonText: 'Date', buttonImage: 'images/calendar.gif', buttonImageOnly: true
    });
    
    toDate.datepicker({
      showTime: false,
      dateFormat: 'dd-mm-yy',
      showOn: 'button',buttonText: 'Date', buttonImage: 'images/calendar.gif', buttonImageOnly: true
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm stuck on a problem and if possible I will need help from the
I'm stuck with a problem how to check if a specific date is within
I've stuck at this problem. Our old-old programmers have encoded their CFM file based
I'm stuck with a problem around parsing date and time: I'm trying to parse
I am stuck on this problem which I am studying for an exam tomorrow.
I am stuck with a problem when testing my controllers with RSpec - the
I got stuck in this problem for an hour. I am thinking this is
I've got stuck in a problem with gflags when trying to find some memory
I'm currently stuck on this problem. I've hooked into the method_missing function in a
I'm hoping someone can help me as I've been stuck on this problem for

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.