Dofactory.com
Dofactory.com
 Back to list
Views:   27.2K
Replies:  1
Archived

Change date format with jQuery UI DatePicker

I have an inline datepicker using jQuery UI, like so:

<div id="datepicker"></div>
I then retrieve the date in Javascript:
// retrieve date
var dt = $('#datepicker').val());
The result is a date: for example:  7/19/11, but I need to redisplay it in this format: d MM, yyyy.
Is there no way to specify a format mask when retrieving the date from DatePicker?

Thanks.
 
Juan Perez, Jul 19, 2011
Reply 1
Try this code...


// Change the format as required...
var dt =  $('#datepicker').datepicker({ dateFormat: 'd-MM-yyyy' });
Rajesh Pillai, Jul 23, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.