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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:46:29+00:00 2026-06-17T07:46:29+00:00

I have a date format that is a one digit month (no leading zero),

  • 0

I have a date format that is a one digit month (no leading zero), followed by a two digit day and 2 digit year.

January 1st, 2013 = 10113

I’m trying to attach a datepicker with the correct format to it but it doesn’t format correctly.

http://jsfiddle.net/S3KyX/1/

<input type="text" id="date" value="10113">
$("#date").datepicker({ dateFormat: 'mddy'});

When the date picker pops up it has the date Oct 11, 2003.

  • 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-17T07:46:30+00:00Added an answer on June 17, 2026 at 7:46 am

    Unfortunately, your format won’t work. if you look at the implementation of datepicker formatDate, you can see that for m it will try to match 1 or 2 digits, because it can’t tell that you mean January and not October ahead of time,

    This method is being called like this, getNumber(‘m’):

    var getNumber = function(match) {
        var isDoubled = lookAhead(match);
        var size = (match == '@' ? 14 : (match == '!' ? 20 :
                (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));
        var digits = new RegExp('^\\d{1,' + size + '}');
        var num = value.substring(iValue).match(digits);
        if (!num)
            throw 'Missing number at position ' + iValue;
        iValue += num[0].length;
        return parseInt(num[0], 10);
    };
    

    as you can see size will be 2 for ‘m’, therefore it will match 2 digits! When in doubt put break points in the code and see what happens (that’s what I just did, using chrome developer tools)

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

Sidebar

Related Questions

I have a date in format "4/5/2011" (month/day/year) in a xlsx file in one
I have one date like 12/05/2012 now i would like to change that format
I have a Date format: 2009-08-10T16:03:03Z that I want to convert to: @MMM dd,
I have a date and I would like to format the date like that:
Let's say I have a date that I can represent in a culture-invariant format
I have a stored procedure that returns data in the format of: Date |
I have a webform with two custom validators: One to validate that a string
I Have Date, that comes to our system in format +0yyyyMMdd For instance 12
I have 2 XML files I'm reading - one has a date/time attribute that's
I wish to construct a date format that will optionally have a time argument.

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.