Tuesday, November 29, 2011

List of Supported date format by jQuery UI Datepicker

In this post, we will see the supported date format by jQuery UI datepicker. I have already posted many articles on jQuery UI datepicker implementation and some other cool features which you can achieve using jQuery UI datepicker.

Read my series of articles about jQuery UI datepicker here.

Below is the list of jQuery UI datepicker format.

Option value Date format
$.datepicker.ATOM "yy-mm-dd"
$.datepicker.COOKIE "D, dd M y"
$.datepicker.ISO_8601 "yy-mm-dd"
$.datepicker.RFC_822 "D, d M y"
$.datepicker.RFC_850 "DD, dd-M-y"
$.datepicker.RFC_1036 "D, d M y"
$.datepicker.RFC_1123 "D, d M yy"
$.datepicker.RFC_2822 "D, d M yy"
$.datepicker.RSS "D, d M y"
$.datepicker.TIMESTAMP @ (UNIX timestamp)
$.datepicker.W3C "yy-mm-dd"

Below is the jQuery code to change the date format.
$(document).ready(function(){
var pickerOpts = {dateFormat: $.datepicker.ATOM};
  $("#txtDate").datepicker(
  { 
    $("#txtDate").datepicker(pickerOpts);
  });
});
Feel free to contact me for any help related to jQuery, I will gladly help you.