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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:40:59+00:00 2026-05-28T06:40:59+00:00

I have inline jQuery UI DatePicker and need to customize format and look of

  • 0

I have inline jQuery UI DatePicker and need to customize format and look of output date, code:

<div id="date-start"></div>
<div class="date start" id="date-start-output"></div>

$(function(){
    // Datepicker
    $('#date-start').datepicker({
        inline:true,            
        showOtherMonths: true,
        altField: "#date-start-value",
        altFormat: "dd M yy",
        dateFormat: "dd M yy",
        onSelect: function(){
            var day1 = $("#date-start").datepicker('getDate').getDate();                 
            var month1 = $("#date-start").datepicker('getDate').getMonth() + 1;             
            var year1 = $("#date-start").datepicker('getDate').getFullYear();               
            var str_output = "<b>" + day1 + "</b><span>" + month1 + "<br />" + year1 + "</span>";
            $('#date-start-output').html(str_output);
        }

    }); 

});

It works, but in #date-start-output I have date format not as “dd M yy” but as “dd m yy”. How can set necessary output format for month?
Also I need to show in #date-start-output current date after page load, I’m trying “beforeShow” event, but it not work together with “onSelect” event for me.

Thanks.

  • 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-28T06:40:59+00:00Added an answer on May 28, 2026 at 6:40 am

    onSelect event handler first parameter is the selected date as text.
    I guess it would be formatted as specified during the initialization

    See http://jqueryui.com/demos/datepicker/#event-onSelect

    $(function(){
        // Datepicker
        $('#date-start').datepicker({
            inline:true,            
            showOtherMonths: true,
            altField: "#date-start-value",
            altFormat: "dd M yy",
            dateFormat: "dd M yy",
            onSelect: function(dateText){
                $('#date-start-output').html(dateText);
            }
        }); 
    });
    

    If you need special formatting, you can try:

    $(function(){
        // Datepicker
        $('#date-start').datepicker({
            ...
            onSelect: function(){
                var dateText = $.datepicker.formatDate("<b>dd</b><span>M<br />yy</span>", $(this).datepicker("getDate"));
                $('#date-start-output').html(dateText);
            }
        }); 
    });
    

    Not sure it will work with HTML tags though

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

Sidebar

Related Questions

I have an inline member function defined under class MyClass int MyClass::myInlineFunction(); This function
Jquery UI Function: // Datepicker $('#datepicker').datepicker({ inline: true }); Event: <input name=txtLogistics_ExecutionDate type=text id=datepicker
Hi I have a MVC create with: <div class=editor-label> @Html.LabelFor(model => model.Date) </div> <div
I have a import directive in my inline .aspx page (no code-behind). Getting an
I have a class that had an inline member, but I later decided that
I am using Jquery Date pickers to get Start and End Dates for an
Ok I have a inline list of buttons. <ul id=nav> <li class=home><a href=#>Menu Item</a></li>
I've created a page which combines an inline jQuery UI datepicker . I wan't
I have a conflict when I use a jquery script for inline window and
I have this code inline in document ready if($.cookie('form_seen') == null) { $(#dialog_form).dialog(open); }

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.