Skip to content

Fixing the DateTime to UK format for the JQuery DateTimePicker

January 18, 2013

On the Jquery DateTimePicker making a date time change would set it in the format mm/dd/yy which initially I had to work with US date times.

If you would like to change the date format to the UK format of dd/mm/yy from mm/dd/yy (US date time) for the JQuery DateTime Picker control.

Simply add the attribute dateFormat to ‘dd/mm/yy’ and that simply works! No need to go into the .js code and alter things inside.

<script type= “text/javascript”>
$(function() {
$(‘#ctl00_content_txtStartTime’).datetimepicker({
dateFormat: ‘dd/mm/yy’,
addSliderAccess: true,
});
$(‘#ctl00_content_txtEndTime’).datetimepicker({
dateFormat: ‘dd/mm/yy’,
addSliderAccess: true,
});
});
</script>

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: