user2169717 user2169717 - 1 year ago 74
jQuery Question

jquery Date picker jquery to UK format

I am using the Jquery datepicker from the website to allow users to select date and was wondering if it would be possible for the displayed date to be shown is the UK format of the date for example 22nd September 2012 is shown in the uk as 22/09/2012 while in American format its 09/22/2012

Answer Source

try this:

$('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' });

$.datepicker.formatDate( format, date, settings )

Format a date into a string value with a specified format.

The format can be combinations of the following:

d - day of month (no leading zero)
dd - day of month (two digit)
o - day of the year (no leading zeros)
oo - day of the year (three digit)
D - day name short
DD - day name long
m - month of year (no leading zero)
mm - month of year (two digit)
M - month name short
MM - month name long
y - year (two digit)
yy - year (four digit)
@ - Unix timestamp (ms since 01/01/1970)
! - Windows ticks (100ns since 01/01/0001)
'...' - literal text
'' - single quote
anything else - literal text
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download