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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:05:11+00:00 2026-06-05T02:05:11+00:00

jQuery(document).ready(function ($) { $.datepicker.setDefaults($.datepicker.regional[]); var lng = $(.language).text().substr(0, 2); $(#dtFrom).datepicker({ dateFormat: ‘mm-dd-yy’ }, $.datepicker.regional[lng]

  • 0
jQuery(document).ready(function ($) {

    $.datepicker.setDefaults($.datepicker.regional[""]);
    var lng = $(".language").text().substr(0, 2);
    $("#dtFrom").datepicker({ dateFormat: 'mm-dd-yy' },
    $.datepicker.regional[lng]
  );
    $("#dtTo").datepicker({ dateFormat: 'mm-dd-yy' },
    $.datepicker.regional[lng]
  );
});

My issue: as the code is above, if ‘lng’ equals ‘fr’ my datepicker is still english, if I comment out the first line ($.datepicker.setDefaults($.datepicker.regional[“”]);) my datepicker always renders french (regardless of the value of ‘lng’). Figure I’m missing something simple. Any ideas how to get this datepicker to render it’s contents in the proper language (french or english based on the value of ‘lng’)?

  • 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-05T02:05:12+00:00Added an answer on June 5, 2026 at 2:05 am

    This is very well explained in the jQuery UI Docs.

    Here’s the demo:

    $(function() {
        $.datepicker.setDefaults( $.datepicker.regional[ "" ] );
        $( "#datepicker" ).datepicker( $.datepicker.regional[ "fr" ] );
        $( "#locale" ).change(function() {
            $( "#datepicker" ).datepicker( "option", $.datepicker.regional[ $( this ).val() ] );
        });
    });
    

    To make your code mimic the demo, this is what i would change:

    jQuery(document).ready(function($) {
        $.datepicker.setDefaults($.datepicker.regional[""]);
        var lng = $(".language").text().substr(0, 2);
        $("#dtFrom,#tdTo").datepicker( $.datepicker.regional[lng] )
            .datepicker( "option", "dateFormat", "mm-dd-yy" );
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery datepicker, please see below code $(document).ready(function() { $(.txtDate).datepicker({ showOn: 'button',
jQuery(document).ready(function(){ $(#button).submit(function() { { var email_id=document.getElementById('textfield').value; var password=document.getElementById('textfield2').value; var utype=document.getElementById(utype).value; var url=login_check.jsp?&email_id=+encodeURIComponent(email_id)+&password=+encodeURIComponent(password)+&utype=+encodeURIComponent(utype); $('form').get(0).setAttribute('action',url); alert(document.form1.action);
This is my jQuery code <script type=text/javascript> jQuery(document).ready(function($){ $(#'.$tag.').dcFlickr({ limit: '.$nFlickr.', style: thumb, q:
I have a jqGrid script like that: jQuery(document).ready(function() { var startDate = $(#startDate).Val(); jQuery(#sandgrid).jqGrid({
On document ready I run this code: jQuery(document).ready(function(){ jQuery('#button').click(function() { jQuery('#contact_form').load(/Users/mge/Downloads/jquery-ajax-1/readme.txt); return false; });
I am using the KendoUi Slider. I'm using the following setings: jQuery(document).ready(function () {
I have this jQuery: $(document).ready(function() { $(#panel).hide(); $('.login').toggle( function() { $('#panel').animate({ height: 150, padding:20px
This is my jQuery: $(document).ready(function(){ $('#mycarousel').jflickrfeed({ limit: 14, qstrings: { id: '26339121@N07' }, itemTemplate:
I have the following jQuery: $(document).ready(function () { $(.element).draggable(); $(.element).droppable({ drop: function () {
I have the following JQuery: $(document).ready(function () { $('tr').hover(function () { $(this).children().addClass(color2); $(this).children().removeClass(color1); });

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.