Jump to content

Datepicker in mm/dd/yy format


jackgoddy123

Recommended Posts

Hello,

   I have the below code with generate date format calender. It properly works for mm/dd/yy format

 

 

 

<html lang="en">

<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
 
<p>Date: <input type="text" id="datepicker"></p>
 
 
</body>
</html>

 

But i want datepicker in dd/mm/yy format. i.e 24/01/14 (dd/mm/yy) format

Can some one help me out. I am quite stuck.

Any kind of help is appreciated.

Link to comment
Share on other sites

A couple of minutes Googling gave

$(function() {
$( "#datepicker" ).datepicker({dateFormat: 'dd/mm/y'});
});

However, I prefer to use "d-M-y" format for datepickers. It's unambiguous about which is the month and which is the day (unlike 04/05/14) and it still works fine with strtotime() unlike d/m/y format

Edited by Barand
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.